@longhongguo/form-create-ant-design-vue 3.2.61 → 3.2.63
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/dist/form-create.css +5 -0
- package/dist/form-create.esm.css +5 -0
- package/dist/form-create.esm.js +2 -2
- package/dist/form-create.esm.js.map +1 -1
- package/dist/form-create.js +2 -2
- package/dist/form-create.js.map +1 -1
- package/package.json +1 -1
- package/src/parsers/flex.js +31 -1
- package/src/style/index.css +5 -0
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.63",
|
|
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
|
@@ -72,7 +72,6 @@ export default {
|
|
|
72
72
|
// 保留用户设置的 display,如果没有则设置为 'flex'
|
|
73
73
|
display: userDisplay || 'flex',
|
|
74
74
|
// 确保 flex 容器占满整行
|
|
75
|
-
width: '100%',
|
|
76
75
|
// 在样式中设置 flexWrap,确保从 props 读取的配置能够生效
|
|
77
76
|
// 这是关键的:将 props.flexWrap 的值('wrap' 或 'nowrap')应用到样式中
|
|
78
77
|
flexWrap: flexWrap,
|
|
@@ -144,6 +143,37 @@ export default {
|
|
|
144
143
|
prop.type = 'a-flex'
|
|
145
144
|
}
|
|
146
145
|
|
|
146
|
+
// 读取 childFlex 配置
|
|
147
|
+
const childFlex = ctx.rule.props?.childFlex ?? ctx.rule.childFlex
|
|
148
|
+
if (childFlex !== undefined && childFlex !== null && childFlex !== '') {
|
|
149
|
+
// 给 flex 容器添加自定义 class 和 CSS 变量,用于 CSS 选择器
|
|
150
|
+
if (!prop.props) {
|
|
151
|
+
prop.props = {}
|
|
152
|
+
}
|
|
153
|
+
// 添加自定义 class
|
|
154
|
+
if (!prop.class) {
|
|
155
|
+
prop.class = []
|
|
156
|
+
}
|
|
157
|
+
if (!Array.isArray(prop.class)) {
|
|
158
|
+
prop.class = [prop.class]
|
|
159
|
+
}
|
|
160
|
+
prop.class.push('_fc-flex-container')
|
|
161
|
+
|
|
162
|
+
// 通过 CSS 变量传递 flex 值
|
|
163
|
+
const flexValue = String(childFlex).trim()
|
|
164
|
+
// 合并到样式中,设置 CSS 变量
|
|
165
|
+
if (!prop.props.style) {
|
|
166
|
+
prop.props.style = {}
|
|
167
|
+
}
|
|
168
|
+
prop.props.style['--fc-child-flex'] = flexValue
|
|
169
|
+
|
|
170
|
+
// 同时也设置到 prop.style
|
|
171
|
+
if (!prop.style) {
|
|
172
|
+
prop.style = {}
|
|
173
|
+
}
|
|
174
|
+
prop.style['--fc-child-flex'] = flexValue
|
|
175
|
+
}
|
|
176
|
+
|
|
147
177
|
// children 会通过 form-create 的机制自动渲染
|
|
148
178
|
const childrenNodes = children || []
|
|
149
179
|
|