0👍
I think I understand the issue now: to have "Select All" option (and by consequence, all options) selected when the page loads.
All the "Select All" option does is toggle the v-model
having all the items, or none of the items. To have "Select All" selected on page load simply requires that the v-model
have all items
assigned to it as it’s initial value.
Using the example code from the Vuetify docs
<v-select v-model="selectedFruits" :items="fruits" multiple>
data: () => ({
fruits: ['Apples', 'Apricots', 'Avocado', 'Bananas'],
selectedFruits: ['Apples', 'Apricots', 'Avocado', 'Bananas']
})
Or, alternatively
data: () => ({
fruits: ['Apples', 'Apricots', 'Avocado', 'Bananas'],
selectedFruits: []
}),
mounted() {
this.selectedFruits = this.fruits.slice()
}
- [Vuejs]-What is the difference between import './style.scss'; in main.ts and css.preprocessorOptions
- [Vuejs]-How to toggle a todo completed option?
Source:stackexchange.com