Skip to content

Commit

Permalink
docs(linkage): change the controlled is display when initialized & dy…
Browse files Browse the repository at this point in the history
…namic controlled field (#3717)
  • Loading branch information
xbsheng authored Feb 16, 2023
1 parent d4bb96c commit 75d36d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/guide/advanced/linkages.md
Original file line number Diff line number Diff line change
Expand Up @@ -932,11 +932,11 @@ const SchemaField = createSchemaField({
Select,
},
scope: {
asyncVisible(field) {
asyncVisible(field, target) {
field.loading = true
setTimeout(() => {
field.loading = false
form.setFieldState('input', (state) => {
form.setFieldState(target, (state) => {
//For the initial linkage, if the field cannot be found, setFieldState will push the update into the update queue until the field appears before performing the operation
state.display = field.value
})
Expand All @@ -961,7 +961,7 @@ export default () => (
x-decorator="FormItem"
x-reactions={{
target: 'input',
effects: ['onFieldValueChange'],
effects: ['onFieldInit', 'onFieldValueChange'],
fulfill: {
run: 'asyncVisible($self,$target)',
},
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/advanced/linkages.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -931,11 +931,11 @@ const SchemaField = createSchemaField({
Select,
},
scope: {
asyncVisible(field) {
asyncVisible(field, target) {
field.loading = true
setTimeout(() => {
field.loading = false
form.setFieldState('input', (state) => {
form.setFieldState(target, (state) => {
//对于初始联动,如果字段找不到,setFieldState会将更新推入更新队列,直到字段出现再执行操作
state.display = field.value
})
Expand All @@ -960,7 +960,7 @@ export default () => (
x-decorator="FormItem"
x-reactions={{
target: 'input',
effects: ['onFieldValueChange'],
effects: ['onFieldInit', 'onFieldValueChange'],
fulfill: {
run: 'asyncVisible($self,$target)',
},
Expand Down

0 comments on commit 75d36d2

Please sign in to comment.