get selectedProp() {
    return this.$store.state.selectedProp;
  }

获取的数据selectedProp直接绑定在表单元素上会有错,因为不能直接对vuex里面的数据进行更改

      <el-radio-group v-model="selectedProp">
            <el-radio size="small" :label="1">&nbsp;</el-radio>
          </el-radio-group>

此时需要使用计算属性的set方法,更改selectedProp的值的时候向vuex直接提交新值:

  set selectedProp(value) {
    this.$store.commit('upSelectedChange', value);
  }

 

相关文章:

  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2020-10-17
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2021-04-21
  • 2022-02-20
  • 2021-12-01
相关资源
相似解决方案