rd-outer-component 0.0.89 → 0.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,8 +74,13 @@ class CustomCheckboxComponent {
74
74
  this.onTouched = fn;
75
75
  }
76
76
  handleValueChange(value) {
77
- this.onChange(value);
78
- this.valueChange.emit(value);
77
+ // 1. 核心修复:对 value 进行深拷贝
78
+ // 这样 emit 出去的就不再是 formFieldStruct 里的原始对象引用了
79
+ const valueCopy = JSON.parse(JSON.stringify(value));
80
+ // 2. 通知 FormArray 更新
81
+ this.onChange(valueCopy);
82
+ // 3. 向外发射新拷贝的对象
83
+ this.valueChange.emit(valueCopy);
79
84
  }
80
85
  }
81
86
  CustomCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomCheckboxComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });