vue array of v-for in the filtering operation

 

Before writing angularjs time, filter can be used directly in the ng-repeat. But this does not work like a vue.

 

Specific solutions:

 

Plus a calculated properties:

        computed:{
            filterData: function () {
                console.log(JSON.parse(JSON.stringify(this.data)));
                return JSON.parse(JSON.stringify(this.data));
            }
        }

 

Then direct reference filterData template on it, all filtering operations can be directly written on the back of that function in filterData property.

 

use:

<Row  v-for="(item, index) in filterData"> </Row>

 

Note: filterData can not be defined in the data, this is a calculated attribute, otherwise it will error.

 

Guess you like

Origin www.cnblogs.com/chenmz1995/p/11220767.html