//偵聽器完整寫法
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í)行回調,默認false
immediate:true}}
承擔因您的行為而導致的法律責任,
本站有權保留或刪除有爭議評論。
參與本評論即表明您已經閱讀并接受
上述條款。