【发布时间】:2021-01-23 10:33:52
【问题描述】:
我在一个组件中有一些数据设置为存储状态,如下所示:
data() {
return {
days: [],
selectedDate: this.selectedDateComputed,
dayJs: this.$store.state.dayJS,
};
},
但是当商店状态更新时 它不会更新组件中的 dayJs 状态。
我尝试将其设为计算属性,使用 selectedDate 数据如下:
selectedDateComputed() {
return this.$store.state.dayJS;
},
但 selectedDate 也不更新。
【问题讨论】: