如何在组件中监听vuex数据变化

//利用计算属性
  computed: {
    listData() {
      return this.$store.state.listData;
    }
  },
  //监听执行
  watch: {
    listData(val) {
     写上你需要的东西
    }
  },

猜你喜欢

转载自blog.csdn.net/qq_42043377/article/details/90696725