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

Form.Array operation.remove方法并没有将form 值删除 #5867

Closed
Julycc41 opened this issue Dec 7, 2022 · 2 comments
Closed

Form.Array operation.remove方法并没有将form 值删除 #5867

Julycc41 opened this issue Dec 7, 2022 · 2 comments

Comments

@Julycc41
Copy link

Julycc41 commented Dec 7, 2022

Version of antd-mobile

No response

Description

当我第一次渲染 Form.Array 只有一条数据的时候 我是想给删除按钮禁用掉,当我进行form.getFieldsValue().contacts.length 进行判断的时候 发现值好像并没有更新
1670385257028
1670385312716

@miracles1919
Copy link
Contributor

推荐用 useWatch

const [form] = Form.useForm<FieldType>()
const contacts = Form.useWatch('contacts', form)

console.log(contacts.length)

@wangxuehao
Copy link

请问最后是怎么解决的呢?

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

3 participants