2

In my Laravel 5.8 / vuejs 2.6 app with "vue-select": "^2.6.4" I
set action when option is selected, but I have 2 problems with it: 1) Looks like Action is triggered on page opened 2) When I select option Action is triggered twice. 3) I tried to set .prevent :

<v-select
    v-model="selection_forum_post_action"
    :options="forumPostActionValueArray"
    id="forum_post_action"
    name="forum_post_action"
    class="form-control editable_field"
    placeholder="Select action"
    @change.prevent="forumPostActionSelected(nextThreadPost.id, nextThreadPost.body, nextThreadPost.creator_name)"
></v-select>

But got console error :

app.js?dt=1571398092:134128 [Vue warn]: Error in v-on handler: "TypeError: $event.preventDefault is not a function"                               

I tried several variants and failed with all. Please working example...

Petro Gromovo
  • 1,755
  • 5
  • 33
  • 91

1 Answers1

2

I found @input working good for me :

<v-select
    v-model="selection_forum_post_action"
    :options="forumPostActionValueArray"
    id="forum_post_action"
    name="forum_post_action"
    class="form-control editable_field"
   placeholder="Select action"
   @input="forumPostActionSelected(nextThreadPost.id, nextThreadPost.body, nextThreadPost.creator_name)"
></v-select>
Petro Gromovo
  • 1,755
  • 5
  • 33
  • 91