item vue v-for change in view of the update can not cause

 

I wrote angularjs students know that if ng-repeat of the item bound to the corresponding model, item change will lead to update the view, but it does not work vue, concrete solutions:

 

In vue scaffolding, first introduced vue

 

First of all

<script>
import
Vue from 'vue';
</script>

 

Added to the component:

    export default {
        components: {
            Vue
        }
    }

 

Then the code calls:

Vue.set(this.data, index, item);

represents subscript index, item represents the individual

 

Guess you like

Origin www.cnblogs.com/chenmz1995/p/11224314.html
Recommended