一定要先拷贝

 

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;

 

相关文章:

  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2021-09-27
  • 2021-08-17
  • 2022-01-03
  • 2021-10-29
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案