监视vuex数据的变化

1
2
3
4
5
6
7
8
9
// vuex 中定义
const base = {
namespaced: true,
state: {
records: -1
}
}

export base
1
2
3
4
// 需要使用的 vue 文件中定义
const records = computed(() => store.state.base.records)
watch(records, (newVal, oldVal) => {
})

监视vuex数据的变化
http://example.com/2023/01/09/监视vuex数据的变化/
Author
John Doe
Posted on
January 9, 2023
Licensed under