关于v-show绑定函数的问题
来源:18-14 评价列表(3)

Mrliufy
2017-09-09
老师,ratingselect派发的消息在父组件收到了,如下:
events: {
'rating.change'(bool) {
this.onlyContent === bool;
console.log('events:'+bool);
},
'rating.select'(type) {
this.selectType === type;
console.log('events:'+type);
}
}
但v-show绑定的needshow却没重新执行,还是之前默认设置的值,导致评价切换按钮失效,v-show="showRating(rating.rateType,rating.text)"
showRating (type, text) {
if (this.onlyContent && !text){
console.log('onlycontent');
return false;
}
if (this.selectType === ALL){
console.log('selectType'+this.selectType);
return true;
}else {
return type === this.selectType;
}
},
写回答
1回答
-
Mrliufy
提问者
2017-09-09
粗心了,问题解决了!
012019-04-03
相似问题
关于 cube-ui的几个问题
回答 1