Commit 0ddc3c46 authored by 田翔's avatar 田翔

fix: 暴露form实例

parent 6dd05e66
{
"name": "panda-xform",
"version": "2.2.1",
"description": "2.2.1: 获取值改为字符串",
"version": "2.2.3",
"description": "2.2.3: 暴露form实例",
"keywords": [
"panda-xform"
],
......
......@@ -17,7 +17,8 @@ const XRender = (props, ref) => {
useImperativeHandle(ref, () => (
{
getValues
getValues,
form
}
))
......@@ -48,7 +49,7 @@ const XRender = (props, ref) => {
})
}
let disabledField = child[s].disabled
if (Array.isArray(disabledFields) && disabledFields.includes(s)) {
if (!disabledFields.includes(s) && !disabledField) {
disabledField = true
}
if (disabled) {
......
......@@ -9,9 +9,9 @@ const SwitchSelector = (props) => {
useEffect(() => {
if (addons) {
addons.setValue(addons.dataPath, presetValue)
addons.setValue(addons.dataPath, Boolean(presetValue))
} else {
onChange(presetValue)
onChange(Boolean(presetValue))
}
}, [presetValue])
......
......@@ -147,7 +147,7 @@ const Fieldshine = (props) => {
treeDefaultExpandAll
showCheckedStrategy
>
<TreeNode value='事件_测试02' title='事件_测试02' disabled>
<TreeNode value={tableNameParent} title={tableNameParent} disabled>
{
index === 0 ? <TreeNode value={$id} title={$id} /> : toField.map(s => <TreeNode value={s.name} title={s.name} key={s.name} />)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment