Vue组件中怎么使用计算属性

2020-05-01 娱乐 78阅读
操作方法如下:
new Vue({
el: '#app',
data:function(){
return {
lists:[
{name:1111,state:1},
{name:2222,state:2},
{name:3333,state:3}]
};
},
computed:{
red:function(){
for( var i = 0; i< this.lists.length; i++ ){
if( this.lists[i].state === 1 ){
return true;
}
}
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com