[Vuejs]-Vue-next-select element not selecting value on selection

0๐Ÿ‘

    <vue-select 
     v-model="tankno" 
     :options="tanks1" 
     searchable 
     @input="form.tankno = $event.target.value" 
     close-on-select label-by="tankno" 
     class="text-left h-10 sinput" 
     search-placeholder=" Search Tank No" 
     placeholder="Select Tank No"  
     track-by="tankno"
     @selected="onSelected"
     ref="selectRef"
    >
    
    </vue-select>

const onSelected = (e) => {
  selectRef.value.input.input.value = e;
}

In my case using Vue js 3, I create template refs (selectRef), then pass the selected value to the search input field.

Leave a comment