简体   繁体   English

Material-UI 仅包含某些组件

[英]Material-UI include only certain component

I just want to include material ui dialogs in my project.我只想在我的项目中包含材质 ui 对话框。 I do not want to include other components in my project.我不想在我的项目中包含其他组件。 So I don't want to install full material ui just to use dialogs.所以我不想安装完整的材料用户界面只是为了使用对话框。 Can anyone help with this?有人能帮忙吗?

https://material-ui.com/components/dialogs/ https://material-ui.com/components/dialogs/

According to the documentation ,根据文件

Tree-shaking of Material-UI works out of the box in modern frameworks. Material-UI 的 Tree-shaking 在现代框架中开箱即用。 Material-UI exposes its full API on the top-level @material-ui import. Material-UI 在顶级@material-ui导入中公开其完整的 API。

Which means importing exactly what you're using will not result into the inclusion of other parts of @material-ui/ in your production build.这意味着准确导入您正在使用的内容不会导致在您的生产构建中包含@material-ui/的其他部分。

Note all of their examples import only the bits used in that particular example, so figuring out what your project needs for each case should not be difficult.请注意,他们的所有示例仅导入该特定示例中使用的位,因此确定您的项目在每种情况下需要什么应该不难。 Besides, whenever you're missing something, you'll get a descriptive error message about it, telling you exactly what you missed.此外,每当您遗漏某些内容时,您都会收到一条关于它的描述性错误消息,准确地告诉您您遗漏了什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM