Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] 重置后$record和值的问题,感觉异步了? #4148

Open
1 task
kikcmime opened this issue May 16, 2024 · 1 comment
Open
1 task

[Bug Report] 重置后$record和值的问题,感觉异步了? #4148

kikcmime opened this issue May 16, 2024 · 1 comment

Comments

@kikcmime
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  properties: {
    product: {
      type: 'string',
      title: '产品线',
      'x-decorator': 'FormItem',
      'x-component': 'ProductSelect',
      'x-component-props': {
        all: true,
        fieldNames: { label: 'cn_name', value: 'id' },
        onChange: () => {
          tableRef.current?.reload(true);
        },
      },
    },
    module: {
      type: 'array',
      title: '模块',
      'x-decorator': 'FormItem',
      'x-component': 'ModuleCascader2',
      'x-component-props': {
        fieldNames: { label: 'cn_name', value: 'id' },
        mode: 'multiple',

product: {{$record.product}}
},
},
}

What is expected?

触发form的重置后为啥$record.product传给组件的值还是存在的或者说是上一次的值

What is actually happening?

重置后product传的希望是空

Package

@formily/reactive@2.3.1


@kikcmime
Copy link
Author

properties: {
product: {
type: 'string',
title: '产品线',
'x-decorator': 'FormItem',
'x-component': 'ProductSelect',
'x-component-props': {
all: true,
fieldNames: { label: 'cn_name', value: 'id' },
},
},
module: {
type: 'array',
title: '模块',
'x-decorator': 'FormItem',
'x-component': 'ModuleCascader2',
'x-component-props': {
fieldNames: { label: 'cn_name', value: 'id' },
mode: 'multiple',
product: {{$record.product}},
},
},
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant