@longhongguo/form-create-ant-design-vue 3.2.99 → 3.3.2

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": "@longhongguo/form-create-ant-design-vue",
3
- "version": "3.2.99",
3
+ "version": "3.3.02",
4
4
  "description": "AntDesignVue版本低代码表单|FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。支持6个UI框架,适配移动端,并且支持生成任何 Vue 组件。内置20种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。",
5
5
  "main": "./dist/form-create.min.js",
6
6
  "module": "./dist/form-create.esm.js",
@@ -55,7 +55,7 @@
55
55
  "@form-create/core": "^3.2.33",
56
56
  "@form-create/utils": "^3.2.31",
57
57
  "@longhongguo/component-antdv-upload": "^3.2.41",
58
- "@longhongguo/form-create-core": "^3.2.57",
58
+ "@longhongguo/form-create-core": "^3.2.59",
59
59
  "moment": "^2.30.1"
60
60
  },
61
61
  "publishConfig": {
@@ -216,8 +216,12 @@ export default {
216
216
  }
217
217
 
218
218
  // 确保 children 存在(如果没有设置,默认为空数组)
219
- if (!ctx.rule.children) {
219
+ // 关键:每次都是创建新的数组,避免多个 text 组件共享同一个数组引用
220
+ if (!ctx.rule.children || !Array.isArray(ctx.rule.children)) {
220
221
  ctx.rule.children = []
222
+ } else {
223
+ // 如果 children 已经存在,创建一个新的数组副本,避免共享引用
224
+ ctx.rule.children = [...ctx.rule.children]
221
225
  }
222
226
 
223
227
  // 对于动态绑定的情况,初始化时设置一个占位符,确保组件能被渲染
@@ -237,9 +241,11 @@ export default {
237
241
  if (bindMode === 'template') {
238
242
  // template 模式下,等待 loadData 执行后更新
239
243
  // 但为了确保组件能渲染,至少设置一个空字符串
244
+ // 关键:每次创建新数组,确保不共享引用
240
245
  ctx.rule.children = ['']
241
246
  } else {
242
247
  // field 模式下,设置一个空格字符串作为占位符
248
+ // 关键:每次创建新数组,确保不共享引用
243
249
  ctx.rule.children = [' ']
244
250
  }
245
251
  }