
provide() {
return {
tb: () => this.data
};
},inject: ["tb"],
computed: {
list() {
return this.tb();
}
},
watch: {
list: {
deep: true,
handler(e) {
console.log("watch", e);
}
}
},方案来自:Vue.js中provide/inject实现响应式数据更新