I need to show a distinct message for each category that the user selects
<v-select multiple style="position: relative; top: 20px;"
color="white" v-if="count == 3 && question" solo placeholder="Please Choose"
v-model="selected.category" :items="categories" item-text="name" return-object></v-select>
Users can select multiple categories and I want to display a specific message for each selected category. To achieve this, I am using a watcher to monitor changes.
watch: {
'selected.category': {
handler(e) {
console.log(e)
this.icon = "mdi-emoticon"
this.text = this.selected.category.chat //Due to selecting multiple categories, this is now an array
this.selection = true
}
},
}
The previous code was designed for single category selection only, but now I want to allow users to select multiple categories. I am struggling to watch deep changes and display the appropriate category message when multiple selections are made. Is there a way to pass the latest selected category index in the handler or just the selected object?