Closed W-Abel-jia closed 3 years ago
[https://stackblitz.com/Edit/ng- Zorro-antd-ivy-8hacfn?file=src/app/app.component.ts](https://stackblitz.com/edit/ng-zorro-antd- Ivy-8hacfn? file = src / app / app.component.ts)
There are two NZ-Form-Control in a NZ-Form-Item tag, that is, as follows:
Template file:
`
HTML
<form nz-form [formgroup] = "Validateform" = "SubmitForm (ValidateForm.Value">
https://github.com/myopenresources/cc-project 这个是用zorro开发的项目,需要的自己下
nz-form-item
的 status
是由它的子组件 nz-form-control
控制的,因此一个 nz-form-item
中确实只应该有一个 nz-form-control
组件.
如果你需要一行内多个表单元素:
nz-form-item
的status
是由它的子组件nz-form-control
控制的,因此一个nz-form-item
中确实只应该有一个nz-form-control
组件。如果你需要一行内多个表单元素:
明白了,谢谢~
Reproduction link
https://stackblitz.com/edit/ng-zorro-antd-ivy-8hacfn?file=src/app/app.component.ts
Steps to reproduce
在一个 nz-form-item 标签中有两个 nz-form-control 时,即如下:
模版文件:
类文件:
在页面上, userName 触发了required 错误的时候,email也会触发 nzValidateStatus 为 error; 当 userName 控件输入了正确的值以后,在email 输入不正确的值时,userName 也会触发 nzValidateStatus为 error;
这里必须要将这两个控件分别单独放在一个nz-form-item中就不会出现此问题。
What is expected?
userName 和 email 分别触发对应的
nzValidateStatus
What is actually happening?
userName 和 email 相会触发对方的
nzValidateStatus