zoukankan      html  css  js  c++  java
  • 修改 vuex $store.state 里取出的数据不响应

    一定要先拷贝

    let { showLabel, actualValue } = this.record;
          let show = this.rowData[showLabel];
          let actual = this.rowData[actualValue];
          const { formGroup } = this.$store.state.right;
          const { dispatch } = this.$store;
          let group = _.cloneDeep(formGroup) // 这一步必须, 如果直接 formGroup.map( ... ) 数据响应不到
          const newFormGroup = group.map(item => {
            if (item.componentx === "modal") {
              item = {
                ...item,
                uniqueKey:createUuid()
              }
              return (item = {
                ...item,
                initValue: show,
                actualValue: actual
              });
            } else {
              return item;
            }
          });
          dispatch("right/updateFormGroup", newFormGroup);
          this.visible = false;
  • 相关阅读:
    unit 21
    unit 20
    unit 19
    第十八单元
    17 unit
    ES 中文分词
    ES 的CRUD 简单操作(小试牛刀)
    ES 必备插件的安装
    ES的安装运行
    JAVA_HOME 的设置
  • 原文地址:https://www.cnblogs.com/winyh/p/12628925.html
Copyright © 2011-2022 走看看