使用闭包传值
computed
:{
checkHasError(){
return function(index
,lang
) {
if(this.wordList
[index
][lang
] == '' && this.wordList
[index
].hasOwnProperty('hasError')){
return {
'has-error':true,
}
}
}
},
},
使用
<div
class="form-group" v
-bind
:class="checkHasError(index,'form_word')">
<textarea v
-bind
:class="'form-control'" v
-model
="item.form_word" :placeholder
="'请输入'+chineseLanguage(item.form_lang)"></textarea
>
</div
>
转载请注明原文地址: https://lol.8miu.com/read-20423.html