You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
我正在使用formily@2.x 的 Schema , 我想实现的是"x-reaction"的链式联动,但是需要依赖其他字段。比如:
当source发生改变的时候,主动去改变target的样式,但是需要获取到的依赖并且用于判断的是controller的value,有什么获取到吗?以下是我尝试的错误写法,我也尝试过使用被动依赖的deps,但是deps会导致controller发生变化的时候,让target也会改变,这并不是我期望的(我想要的是一定是source改变时候去变更target) 求助 各位大佬们!
{
"form": {
"labelCol": 6,
"wrapperCol": 12
},
"schema": {
"type": "object",
"properties": {
"source": {
"type": "string",
"x-component": "Input",
"x-reactions": {
"target":"target",
"fulfill": {
"run": "$form.setFieldState('target',state=>{state.visible = $form.getValue('controller') === '123'})"
}
},
"name": "source",
"x-designable-id": "z5i598smce0",
"x-index": 0
},
"controller": {
"type": "string",
"x-component": "Input",
"name": "controller",
"x-designable-id": "368teysrddk",
"x-index": 1
},
"target": {
"type": "string",
"x-component": "Password",
"name": "target",
"x-designable-id": "z5i598smce0",
"x-index": 2
}
},
"x-designable-id": "dqen14o0d8j"
}
}
Beta Was this translation helpful? Give feedback.
All reactions