watch:{
getorderid(curval,oldval){   //监听了computed中getorderid的值,如果发生改变就触发console.log
console.log(`最新值${curval}--旧值${oldval}`);
}
},
computed:{      //同步了store中state内的orderid值
getorderid(){
return this.$store.state.orderid;
}
}
Logo

前往低代码交流专区

更多推荐