如何在 ant-design React App 中使用 ant-design-pro 组件?

2024-06-01

我已经使用 create-react-app 创建了 React 应用程序,并使用了 ant-design 组件,随着项目变得更大,我需要使用 ant-design-pro 中的一些很棒的组件。

有没有办法将ant-design-pro组件集成到现有的ant-design项目中?

我尝试导入和使用 @ant-design/pro-layout 但对我不起作用。


对于 V4,请参阅升级到V4 https://github.com/ant-design/ant-design-pro-site/edit/master/docs/upgrade-v4.en-US.md, check 替换基本布局 https://pro.ant.design/docs/upgrade-v4#replace-basiclayout如果你使用@ant-design/pro-layout.

对于单一组件使用npm install [email protected] /cdn-cgi/l/email-protection并根据您的需要导入组件:

import Ellipsis from 'ant-design-pro/lib/Ellipsis';

Demo:

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 ant-design React App 中使用 ant-design-pro 组件? 的相关文章

随机推荐