Vuetify v0.17.6: How to get the autocomplete text inside v-select

混江龙づ霸主 提交于 2019-12-03 20:12:33

You can bind it by using :search-input.sync:

<v-select :search-input.sync="searchInput"

add searchInput variable to your data

data() {
    return {
         //...
         searchInput: "",
    };
}, 

example pen

Additionally, if it seems "laggy" that's because of debounce-search property, which adds 200ms delay. You can change it to 0 if you want to catch value every time it's changed:

:debounce-search="0"

In the template:

<v-select
    :items="itemList"
    :search-input.sync="searchInput"
    item-text="name"
    autocomplete
/>

In the script

data: () => ({
    itemList: [{name: 'John'}, {name: 'Doe'}],
    searchInput: ""
}),

I don't know if there's a more efficient way with Vuetify, but you should be able to just use v-on:input=handleInput with a handleInput method (or whatever) to receive the value.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!