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

dynamicImport后,会导致uform field样式丢失 #473

Closed
birdycn opened this issue Dec 7, 2019 · 5 comments · Fixed by #485
Closed

dynamicImport后,会导致uform field样式丢失 #473

birdycn opened this issue Dec 7, 2019 · 5 comments · Fixed by #485
Labels
bug Something isn't working

Comments

@birdycn
Copy link

birdycn commented Dec 7, 2019

报告一个antd pro v4+uform的样式bug,开启dynamicImport后,会导致uform field样式丢失(其他组件不知道有没有这种情况)

手动import antd form样式可解决问题

@Sayid1
Copy link

Sayid1 commented Dec 10, 2019

同问,如果全部引入antd.css,那包太大了

@birdycn
Copy link
Author

birdycn commented Dec 10, 2019

同问,如果全部♡antd.css,那包太大了

试了一下好像不是dynamicImport的问题,现在把dynamicImport关了,也无法加载css。之前能加载是因为我在同级其他页面使用了antd组件,现在我把其他页面的antd组件删了,uform也加载不了样式了

@Sayid1
Copy link

Sayid1 commented Dec 11, 2019

同问,如果全部♡antd.css,那包太大了

试了一下好像不是dynamicImport的问题,现在把dynamicImport关了,也无法加载css。之前能加载是因为我在同级其他页面使用了antd组件,现在我把其他页面的antd组件删了,uform也加载不了样式了

不管是不是dynamicImport的问题,我觉得不应该手动引入antd的样式了,就像使用antd组件一样,使用某个组件就会带上组件的样式

@shengliangli
Copy link

shengliangli commented Dec 11, 2019

antd 能够自动导入组件的样式是使用了 babel 插件:babel-plugin-import 。该插件实现的只是把具体要用到的组件的样式自动插入到页面,如果 uform 暂时无法提供动态载入的插件,可以在页面用笨办法自己引入某些组件的样式,但是需要知道自己都使用了什么组件,而且还有很多公共的样式需要引入。索引,目前来看,引入 antd.css 是一个比较省事的方法,虽然大了点

@janryWang
Copy link
Collaborator

这个问题是个Bug,在修哈

@janryWang janryWang added the bug Something isn't working label Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants