-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
dynamicImport后,会导致uform field样式丢失 #473
Comments
同问,如果全部引入antd.css,那包太大了 |
试了一下好像不是dynamicImport的问题,现在把dynamicImport关了,也无法加载css。之前能加载是因为我在同级其他页面使用了antd组件,现在我把其他页面的antd组件删了,uform也加载不了样式了 |
不管是不是dynamicImport的问题,我觉得不应该手动引入antd的样式了,就像使用antd组件一样,使用某个组件就会带上组件的样式 |
antd 能够自动导入组件的样式是使用了 babel 插件:babel-plugin-import 。该插件实现的只是把具体要用到的组件的样式自动插入到页面,如果 uform 暂时无法提供动态载入的插件,可以在页面用笨办法自己引入某些组件的样式,但是需要知道自己都使用了什么组件,而且还有很多公共的样式需要引入。索引,目前来看,引入 antd.css 是一个比较省事的方法,虽然大了点 |
这个问题是个Bug,在修哈 |
报告一个antd pro v4+uform的样式bug,开启dynamicImport后,会导致uform field样式丢失(其他组件不知道有没有这种情况)
手动import antd form样式可解决问题
The text was updated successfully, but these errors were encountered: