1.引入 注意要大寫?import {Component,Prop,Watch, Vue}from 'vue-property-decorator';
2.需要監(jiān)聽的數(shù)據(jù)
@Watch('監(jiān)聽的數(shù)據(jù)名字')
getVisible(newVal, oldVal) {
console.log("newVal", newVal, "oldVal", oldVal)
};
案例demo

1.引入 注意要大寫?import {Component,Prop,Watch, Vue}from 'vue-property-decorator';
2.需要監(jiān)聽的數(shù)據(jù)
@Watch('監(jiān)聽的數(shù)據(jù)名字')
getVisible(newVal, oldVal) {
console.log("newVal", newVal, "oldVal", oldVal)
};
案例demo