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

数组组件如何修改字段 #690

Open
hanfengcan opened this issue Apr 3, 2024 · 2 comments
Open

数组组件如何修改字段 #690

hanfengcan opened this issue Apr 3, 2024 · 2 comments

Comments

@hanfengcan
Copy link

@form-create/naive-ui: ^3.1.28

数组组件如何对字段进行setValue

{
  type: 'group',
  props: {
    rule: [
      ...字段1,
      ...字段2,
      {
        type: 'select',
        update(value, rule, fApi) {
          fApi.setValue(‘字段1’, 1)
          fApi.setValue(‘字段1’, 2)
        }
      }
    ]
}

在数组表单里面进行update监听,修改字段后,在最外层进行formData()读取不到设置的内容。对于数组表单,应该如何操作

@xaboy
Copy link
Owner

xaboy commented Apr 24, 2024

这边没有复现, 测试setValue后,group组件和最外层表单的值会同步变化

@hanfengcan
Copy link
Author

哦,那我在测试测试

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

2 participants