[Vuejs]-Select All Feature in v-select not save all the items

0👍

You are trying to edit a prop directly, which should give you following warning:

Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop’s value.

To work with v-model you can use a computed setter/getter:


computed : {
  _user : {
     get () {
        return this.user
     },
     set (val) {
        this.$emit('change', val)
     }
   }
}

and direct the v-model on your v-select to the computed property <v-select v-model="_user.versions">

working example https://codepen.io/ellisdod/pen/jOPeRyr?editable=true&editors=101

Leave a comment