I tried to use Vue.js to make a Select with a list of options and one option called 'Any' which will select all options.
I want to use HTML select Tag, not a checkbox.
I am trying to do something like this but I am not sure it is the right way to do it.
<div id="app">
<select v-model="selected">
<option v-for="option in options" v-bind:value="option.value">{{option.text}}</option>
</select>
<span>Selected: {{ selected }}</span>
</div>
let app = new Vue({
el: '#app',
data: {
selected: ['A', 'B', 'C'],
options: [
{ text: 'One', value: 'A' },
{ text: 'Two', value: 'B' },
{ text: 'Three', value: 'C' },
{ text: 'Any', value: ['A', 'B', 'C'] },
]
}
});