@form-create/component-elm-group 2.5.20 → 2.5.26

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@form-create/component-elm-group",
3
- "version": "2.5.20",
3
+ "version": "2.5.26",
4
4
  "description": "@form-create/element-ui 内置组件",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "196b3c5b14af477d3d86fa37418a60e47ac4bc1f"
42
+ "gitHead": "a98b4876f74f56f070980b81834c7fa10e23b2e9"
43
43
  }
package/src/component.jsx CHANGED
@@ -80,14 +80,20 @@ export default {
80
80
  handler(n, o) {
81
81
  Object.keys(this.cacheRule).forEach(v => {
82
82
  const item = this.cacheRule[v];
83
- if (n === o) {
84
- deepExtend(item.rule, n)
85
- } else {
83
+ if (item.$f) {
86
84
  const val = item.$f.formData();
87
- item.$f.once('reload', () => {
88
- item.$f.setValue(val);
89
- })
90
- item.rule = deepCopy(n);
85
+ if (n === o) {
86
+ item.$f.deferSyncValue(() => {
87
+ deepExtend(item.rule, n);
88
+ item.$f.setValue(val);
89
+ }, true);
90
+ } else {
91
+ const val = item.$f.formData();
92
+ item.$f.once('reloading', () => {
93
+ item.$f.setValue(val);
94
+ })
95
+ item.rule = deepCopy(n);
96
+ }
91
97
  }
92
98
  })
93
99
  },
@@ -275,17 +281,22 @@ export default {
275
281
  const {rule, options} = this.cacheRule[key];
276
282
  return <ElRow align="middle" type="flex" key={key}
277
283
  style="border-bottom:1px dashed #DCDFE6;margin-bottom:10px;">
278
- <ElCol span={button ? 20 : 24}><ElFormItem><Type
279
- key={key} inFor={true}
284
+ <ElCol span={button ? 20 : 24}><Type
285
+ key={key}
280
286
  on={{
281
287
  'update:value': (formData) => this.formData(key, formData),
282
288
  'emit-event': (name, ...args) => this.emitEvent(name, args, index, key),
283
289
  input: ($f) => this.add$f(index, key, $f)
284
290
  }}
285
- value={this.field ? {[this.field]: this._value(this.value[index])} : this.value[index]}
286
- rule={rule}
287
- option={options} extendOption={true}/></ElFormItem></ElCol>
288
- {button ? <ElCol span={2} pull={1} push={1}>{this.makeIcon(keys.length, index, key)}</ElCol> : null}
291
+ props={{
292
+ value: this.field ? {[this.field]: this._value(this.value[index])} : this.value[index],
293
+ rule,
294
+ option: options,
295
+ extendOption: true,
296
+ inFor: true
297
+ }}/></ElCol>
298
+ {button ? <ElCol
299
+ props={{span: 2, pull: 1, push: 1}}>{this.makeIcon(keys.length, index, key)}</ElCol> : null}
289
300
  </ElRow>
290
301
  })}</div>
291
302
  }