@longhongguo/form-create-ant-design-vue 3.3.33 → 3.3.35

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.3.33",
3
+ "version": "3.3.35",
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",
@@ -86,7 +86,10 @@ export default {
86
86
 
87
87
  // 应用 componentStyle 到包裹组件的最顶层父容器(如 .fc-form-col)
88
88
  // 这样在 Flex 或 Space 布局中,可以给子元素设置 flex: 1 等样式
89
- if (ctx.rule.componentStyle && typeof ctx.rule.componentStyle === 'object') {
89
+ if (
90
+ ctx.rule.componentStyle &&
91
+ typeof ctx.rule.componentStyle === 'object'
92
+ ) {
90
93
  // 将 componentStyle 合并到 prop.style,这会应用到包裹组件的容器上
91
94
  const existingStyle = ctx.prop.style || {}
92
95
  ctx.prop.style = {
@@ -462,7 +465,7 @@ export default {
462
465
  isFalse(col.show) ||
463
466
  shouldDisableCol
464
467
  ? item
465
- : this.makeCol(rule, uni, [item])
468
+ : this.makeCol(rule, uni, [item], ctx)
466
469
  },
467
470
  isTitle(rule) {
468
471
  if (this.options.form.title === false) return false
@@ -544,13 +547,16 @@ export default {
544
547
 
545
548
  return this.$r(_prop, children)
546
549
  },
547
- makeCol(rule, uni, children) {
550
+ makeCol(rule, uni, children, ctx) {
548
551
  const col = rule.col
552
+ // 将 componentStyle 应用到 col 容器上
553
+ const style = ctx?.prop?.style || {}
549
554
  return this.$r(
550
555
  {
551
556
  class: this.$render.mergeClass(col.class, 'fc-form-col'),
552
557
  type: 'col',
553
558
  props: col || { span: 24 },
559
+ style: style,
554
560
  key: `${uni}col`
555
561
  },
556
562
  children
@@ -249,8 +249,13 @@ export default {
249
249
 
250
250
  // 将 flex 容器包装在 col 中,确保它占满整行(span: 24)
251
251
  // 这样 flex 容器才能有足够的宽度,子项才能自适应展示
252
+ // 应用 componentStyle 到 col 容器(如果存在)
253
+ const componentStyle = ctx.rule.componentStyle || {}
252
254
  return ctx.vNode.col(
253
- { props: { span: 24 } },
255
+ {
256
+ props: { span: 24 },
257
+ style: componentStyle
258
+ },
254
259
  {
255
260
  default: () => [ctx.vNode.make('a-flex', prop, childrenNodes)]
256
261
  }
@@ -122,8 +122,13 @@ export default {
122
122
 
123
123
  // 将 space 容器包装在 col 中,确保它占满整行(span: 24)
124
124
  // 这样 space 容器才能有足够的宽度
125
+ // 应用 componentStyle 到 col 容器(如果存在)
126
+ const componentStyle = ctx.rule.componentStyle || {}
125
127
  return ctx.vNode.col(
126
- { props: { span: 24 } },
128
+ {
129
+ props: { span: 24 },
130
+ style: componentStyle
131
+ },
127
132
  {
128
133
  default: () => [ctx.vNode.make(prop.type, prop, childrenNodes)]
129
134
  }