My plugin (vue-select@latest)
I can successfully get data from the object cities but how do I add a value , for example <span class="selected-tag" value="Moscow" or value="New York">
I'm new to Vue js , I want to use the plugin vue-select , my problem is that I can not add the value attribute. My attempts fail
<v-select :options="locations" label="name" v-model="country" value="value" ></v-select>
I create a dynamic combobox from the object cities: ['Moscow', 'Sp', 'Tomsk' , 'Voronezh', 'Novossibirsk'],
and I want all the data from the combobox to attribute value, for Example value="Moscow"
let sample =new Vue({
el: '#app',
data: {
country: null,
city: null,
locations: [
{
name: 'Russia',
cities: ['Moscow', 'Sp', 'Tomsk' , 'Voronezh', 'Novossibirsk'],
value: ['Moscow', 'Sp', 'Tomsk' , 'Voronezh', 'Novossibirsk']
},
{
name: 'USA',
cities: ['LA', 'Pensacola', 'New York'],
value: ['LA', 'Pensacola', 'New York']
}
]
},
link to codepen My cdn libary
<script src="https://unpkg.com/vue-select@latest"></script>