computed: {
    swiper() {
      return this.$refs.mySwiper.$swiper;
    },
    LifeVal() {
      return this.$store.state.LifeVal;
    },
    danceVal(){
      return this.$store.state.danceVal;
    }
  },
 
  watch: {
   
    danceVal: function() {
        LifeVal = this.$store.state.LifeVal = this.$store.state.danceVal
/* vuex : changeDanceVal是store中mutations里的方法
  // 修改state的唯一方法,只允许同步函数
   mutations: {
     // 第一个参state值,第二个接收触发方法时传来的值
     changeDanceVal(state,num) {
      state.LifeVal = num;
     }
   },
*/
        this.$store.commit("changeDanceVal"LifeVal);
      
    }
  },

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-03
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案