ant-design-vue
ant-design-vue copied to clipboard
The test environment is packaged. After the clearValidate of the form is executed, the class name is not cleared, resulting in style problems.
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Version
2.2.8
Environment
vue 3.2.26
Reproduction link
Steps to reproduce
只有测试环境打包会出现该问题,本地和生产环境都没有问题(提供的在线链接没什么用,但是不提供无法提交)
- 表单不填写必填项,点击提交,触发提示信息,此时dom上会增加类名"ant-form-item-has-error ant-form-item-with-help"
- 调用clearValidate(),清空表单校验信息,但是类名只去掉了"ant-form-item-has-error",未去掉"ant-form-item-with-help",导致样式出现问题:margin-bottom: 0;表单项之间没有间距

What is expected?
能正确去除类名
What is actually happening?
类名没有完全清除,导致样式问题
测试环境有各种 mock ,不要用测试环境打包
测试环境有各种 mock ,不要用测试环境打包
好吧,因为在测试环境测试,所以才发现的这个问题。但是看起来也没什么办法改,就只能先这样了。感谢回答!
测试环境是用来跑CI 测试用例的 ,你自己的业务测试环境应该是 production test
测试环境是用来跑CI 测试用例的 ,你自己的业务测试环境应该是 production test
那请问组件库打包的时候是怎么区分的呢?对我传入的mode值有什么要求吗?我现在测试环境的打包命令是vite build --mode test,是因为test这个值让他按照测试来打包了吗?
process.env.NODE_ENV === 'test'
process.env.NODE_ENV === 'test'
换了一个mode值,问题解决了。非常感谢!
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.