form-create-designer
form-create-designer copied to clipboard
获取表单层级结构api getFormDescription没有返回option
有一个需求需要使用 options 中的数据作为判断条件,现在该怎么实现
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}; }这行
最新版本已优化