sagalbot / vue-select

Everything you wish the HTML <select> element could do, wrapped up into a lightweight, extensible Vue component.
https://vue-select.org
MIT License
4.62k stars 1.33k forks source link

Vue 3 @input or @change not triggering function. #1728

Closed VinceSanityyy closed 1 year ago

VinceSanityyy commented 1 year ago

Please respect maintainers time by filling in these sections. Your issue will likely be closed without this information.

Describe the bug @input or @change wont trigger functions inside the methods

  methods:{
    getOutcomes(){
        alert(1)
    }
  },

Expected behavior Method should be called

Here is what I tried <v-select @input="getOutcomes()" v-model="selectedOutcome" :options="curriculums" label="name" ></v-select>

sagalbot commented 1 year ago

There's no input event in the vue 3 version of the component, since the v-modelevent changed to update:modelValue. You can use update:modelValue instead.

VinceSanityyy commented 1 year ago

I tried this example @option:selected="getOutcomes" seems working. Is it similar? @sagalbot based on here https://github.com/sagalbot/vue-select/issues/1695