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
i am using formily with antd5 and json schema to build dynamic forms i want to pass custom functions for my use cases in "x-reactions" run and i am facing issues doing that
here's an example: "x-reactions": [ { dependencies: [ { property: "value", type: "string", source: "chain", name: "chain", }, ], fulfill: { state: { value: '{{""}}', }, }, }, { dependencies: [ { property: "value", type: "any", source: "chain", name: "chainValue", }, ], fulfill: { run: "$effect(()=>{\r\n $self.loading = true\r\n fetch('data.json')\r\n .then(response=>response.json())\r\n .then(({ data })=>{\r\n $self.loading = false\r\n $self.dataSource = data[$deps.chainValue]\r\n },()=>{\r\n $self.loading = false\r\n })\r\n},[ $deps.chainValue ])", }, }, { dependencies: [ { property: "value", type: "string", source: "chain", name: "chain", }, { property: "modified", type: "boolean", source: "chain", name: "chainModified", }, ], fulfill: { run: "", state: { pattern: "{{$deps.chainModified ?$deps.chain ? 'editable' : 'disabled': 'disabled'}}", }, }, }, ],
instead of the fetch('data.json') i want to pass another function that returns a promise but when i pass my function i am a getting an error that the function is not defined
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
-
i am using formily with antd5 and json schema to build dynamic forms i want to pass custom functions for my use cases in "x-reactions" run and i am facing issues doing that
here's an example:
"x-reactions": [ { dependencies: [ { property: "value", type: "string", source: "chain", name: "chain", }, ], fulfill: { state: { value: '{{""}}', }, }, }, { dependencies: [ { property: "value", type: "any", source: "chain", name: "chainValue", }, ], fulfill: { run: "$effect(()=>{\r\n $self.loading = true\r\n fetch('data.json')\r\n .then(response=>response.json())\r\n .then(({ data })=>{\r\n $self.loading = false\r\n $self.dataSource = data[$deps.chainValue]\r\n },()=>{\r\n $self.loading = false\r\n })\r\n},[ $deps.chainValue ])", }, }, { dependencies: [ { property: "value", type: "string", source: "chain", name: "chain", }, { property: "modified", type: "boolean", source: "chain", name: "chainModified", }, ], fulfill: { run: "", state: { pattern: "{{$deps.chainModified ?$deps.chain ? 'editable' : 'disabled': 'disabled'}}", }, }, }, ],
instead of the fetch('data.json') i want to pass another function that returns a promise but when i pass my function i am a getting an error that the function is not defined
Beta Was this translation helpful? Give feedback.
All reactions