[Vuejs]-V-chip-group value is undefined

0👍

You can watch the value and then reset it, but I’m wondering why you want this behaviour? Is it because you need to evaluate if the value is -1 so that you can do something else? I’m asking because I feel it makes sense for the component to set its value to ‘undefined’ when it is deselected.

data() {
  return {
    selectedItem: -1
  };
},
watch: {
  selectedItem(v) {
    console.log(v);
    if (!v) {
      this.selectedItem = -1;
    }
  }
}

Leave a comment