@longhongguo/form-create-ant-design-vue 3.2.97 → 3.2.98
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.
|
|
3
|
+
"version": "3.2.98",
|
|
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",
|
package/src/parsers/flex.js
CHANGED
|
@@ -110,24 +110,15 @@ export default {
|
|
|
110
110
|
ctx.rule.children = []
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
// 读取 childFlex 和 childWidth 配置,用于直接设置到子元素的 style
|
|
114
|
-
const childFlex = props.childFlex ?? ctx.rule.childFlex
|
|
115
|
-
const isVertical =
|
|
116
|
-
flexDirection === 'column' || flexDirection === 'column-reverse'
|
|
117
|
-
const childWidth = isVertical
|
|
118
|
-
? props.childWidth ?? ctx.rule.childWidth ?? '100%'
|
|
119
|
-
: undefined
|
|
120
|
-
|
|
121
113
|
// 为 flex 容器的所有子组件设置 col: false,避免被 a-col 包装
|
|
122
|
-
// 同时直接给子元素设置 flex 值和宽度(如果是垂直方向)
|
|
123
114
|
// 这样可以确保子组件直接作为 flex 子项,而不是占满整行
|
|
124
115
|
if (ctx.rule.children && Array.isArray(ctx.rule.children)) {
|
|
125
116
|
ctx.rule.children.forEach((child) => {
|
|
126
117
|
if (
|
|
127
118
|
child &&
|
|
128
119
|
typeof child === 'object' &&
|
|
129
|
-
child.type
|
|
130
|
-
child.type
|
|
120
|
+
!child.type === 'DragTool' &&
|
|
121
|
+
!child.type === 'DragBox'
|
|
131
122
|
) {
|
|
132
123
|
// 只有当 col 未设置或为默认值时才设置
|
|
133
124
|
if (child.col === undefined || child.col === null) {
|
|
@@ -139,29 +130,6 @@ export default {
|
|
|
139
130
|
) {
|
|
140
131
|
child.col.show = false
|
|
141
132
|
}
|
|
142
|
-
|
|
143
|
-
// 确保子元素的 style 对象存在(使用响应式的方式)
|
|
144
|
-
if (!child.style) {
|
|
145
|
-
child.style = {}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// 如果配置了 childFlex,直接给子元素设置 flex 样式
|
|
149
|
-
// 使用 Object.assign 确保样式对象被正确设置
|
|
150
|
-
if (
|
|
151
|
-
childFlex !== undefined &&
|
|
152
|
-
childFlex !== null &&
|
|
153
|
-
childFlex !== ''
|
|
154
|
-
) {
|
|
155
|
-
const flexValue = String(childFlex).trim()
|
|
156
|
-
// 直接设置 flex 属性,确保样式能够生效
|
|
157
|
-
Object.assign(child.style, { flex: flexValue })
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// 如果是垂直方向且配置了 childWidth,直接给子元素设置 width 样式
|
|
161
|
-
if (isVertical && childWidth) {
|
|
162
|
-
const widthValue = String(childWidth).trim()
|
|
163
|
-
Object.assign(child.style, { width: widthValue })
|
|
164
|
-
}
|
|
165
133
|
}
|
|
166
134
|
})
|
|
167
135
|
}
|