//偵聽器完整寫法
watch:{score:{handler(newValue,oldValue){console.log(newValue,oldValue);this.isPass = this.score>=90?'合格':'不合格';let num = newValue-oldValue;let str ='';if(num>0){str=`上升了${num}分`}else{str=`下降了${Math.abs(num)}分`}this.str=str},
//是否強制立即執(zhí)行回調(diào),默認(rèn)false
immediate:true}}
承擔(dān)因您的行為而導(dǎo)致的法律責(zé)任,
本站有權(quán)保留或刪除有爭議評論。
參與本評論即表明您已經(jīng)閱讀并接受
上述條款。