vue multiselect filter(get select$)

Viewed 42

This is component and API https://github.com/vueform/multiselect

Event Attributes Description
@search-change query, select$ Emitted after a character is typed.

i need to get select$.filteredOptions

  methods: {
    inputQuery(query, select$){
      console.log(query, select$);
    },

in console: "query"- this is symbols, which i inputed "select$" - undefined, but it should be "proxy" this select

Perhaps this trouble arose due to the fact that Multiselect was raised through an intermediary component.

<SelectComponent v-model="countryId" :options="countries" />    
    

#SelectComponent.vue

<Multiselect
      :options="options"
      @search-change="inputQuery"

Props are passed here and events too so that it works for all the select in app
Can someone tell me what can be done to see "select$" ?

Emmiting events don't help me

<SelectComponent  @searchChange="inputQuery2" />

 methods: {
    inputQuery2(query,select$){
      console.log(query,select$);
    },

#SelectComponent.vue

<Multiselect
    @search-change="inputQuery"

emits: ['search-change'],   
methods: {  
    inputQuery(query,select$){
      this.$emit('search-change', query, select$);
    },
1 Answers

It seems that you are working with an async promise variant of the Multiselect component entry.

You can try changing your method setup to support the async operation: (also note that you were missing a spacebar after 'query,')

methods: {
async inputQuery(query, select$) {
Related