@longhongguo/form-create-ant-design-vue 3.3.12 → 3.3.13

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.12",
3
+ "version": "3.3.13",
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",
@@ -173,12 +173,20 @@ export default {
173
173
  ) {
174
174
  const cellType = column.cellType
175
175
  const dataIndex = column.dataIndex
176
- const cellOptions = column.cellOptions || []
176
+ // 确保 cellOptions 是数组
177
+ let cellOptions = column.cellOptions
178
+ if (!Array.isArray(cellOptions)) {
179
+ cellOptions = []
180
+ }
177
181
  const cellProps = column.cellProps || {}
178
182
 
179
183
  // 创建 customRender 函数
180
184
  column.customRender = ({ text, record, index }) => {
181
185
  const cellValue = record && dataIndex ? record[dataIndex] : text
186
+ // 在 render 函数内部再次确保 cellOptions 是数组(因为可能在外部被修改)
187
+ const options = Array.isArray(column.cellOptions)
188
+ ? column.cellOptions
189
+ : []
182
190
 
183
191
  if (cellType === 'input') {
184
192
  // 渲染 input 组件 - 使用组件名字符串
@@ -226,7 +234,7 @@ export default {
226
234
  },
227
235
  {
228
236
  default: () =>
229
- cellOptions.map((opt) => {
237
+ options.map((opt) => {
230
238
  return h('a-select-option', {
231
239
  key: opt.value,
232
240
  value: opt.value,
@@ -258,7 +266,7 @@ export default {
258
266
  },
259
267
  {
260
268
  default: () =>
261
- cellOptions.map((opt) => {
269
+ options.map((opt) => {
262
270
  return h(
263
271
  'a-radio',
264
272
  {