export default {data () { return {
items: this.$store.getters['webui/getDashboardOptions'], // 這里調(diào)用沒有問題,能夠觸發(fā)到getDashboardOptions
fullScreen: false
}
},
computed: {
activeStation () { return this.$store.getters['webui/activeStation']
},
stationData () { return this.$store.getters['station/stationDataPivot']
}
},
watch: {
stationData (newValue, oldValue) { this.items = this.$store.getters['webui/getDashboardOptions']
// 這里如果有數(shù)據(jù)刷新,觸發(fā)不了
},
2 回答

慕運維8079593
TA貢獻1876條經(jīng)驗 獲得超5個贊
第二次調(diào)用是在stationData 發(fā)生變化的時候才會執(zhí)行this.items = this.$store.getters['webui/getDashboardOptions'] ;

慕妹3242003
TA貢獻1824條經(jīng)驗 獲得超6個贊
如果想要items與this.$store.getters['webui/getDashboardOptions']綁定,可以把items改為計算屬性computed
添加回答
舉報
0/150
提交
取消