Hi I have a select element where the last option is supposed to initiate a rest call to log out the user
Here is what i have tried so far
<select ref:logout>
<option selected value={$user.role}>{$user.role}</option>
{#each $user.pages as page}
<option value={page}>{page}</option>
{/each}
<option on:click="logout()" value='logout'>Logout</option>
</select>
<script>
export default {
methods: {
logout() {
console.log("well hello");
}
};
</script>
The problem is that the logout method never gets called
Update
The problem was that I was using click
event instead of change
and placed it on the option
element instead of the select