form-create-designer icon indicating copy to clipboard operation
form-create-designer copied to clipboard

获取表单层级结构api getFormDescription没有返回option

Open leikui opened this issue 9 months ago • 1 comments

有一个需求需要使用 options 中的数据作为判断条件,现在该怎么实现

leikui avatar Mar 27 '25 14:03 leikui

export const getFormRuleDescription = (tree) => { const getTree = (children) => { const tree = []; children && children.forEach(rule => { if (rule.field) { rule.children = getTree(rule.children || []); if (!rule.children.length) { delete rule.children; } if (rule.options) { rule.options = {...rule.options}; } tree.push(rule); } else { tree.push(...getTree(rule.children || [])); } }); return tree; } return getTree(tree); };能否添加 if (rule.options) { rule.options = {...rule.options}; }这行

leikui avatar Mar 27 '25 14:03 leikui

最新版本已优化

xaboy avatar Jul 07 '25 14:07 xaboy