Open tikvarova opened 4 years ago
Use v-model
directive directly.
Some code for example below
<v-suggest
show-field="name"
v-model="userName"
:data="list"
>
</v-suggest>
<script>
export default {
data () {
return {
list: [
{ name: 'tom' },
{ name: 'jerry' },
]
userName = 'jerry'
}
}
}
</script>
Dear Terry,
Thanks for the answer, but what will be the proper solution if we need to set "row", not only "text". For example at the moment I use wrapper component which holds v-suggest. I use props to set list items and current object:
The list contains data in simmilar format:
// List object is similar to:
{
id: 1, name: "test1",
id: 2, name: "test2",
id: 3, name: "test3",
id: 4, name: "test4",
...
...
...
}
Then in wrapper component I use some parameters like:
ref="suggested" :key-field="keyField" :data="list" @values="values" @clear="$emit('clear')" :show-field="showField":full-list="true" etc.
and than use something like this:
Githubissues.
Githubissues is a development platform for aggregating issues.
Dear Terry,
What is the best way to set default value(selection) from a props?
10X in advance