如何在 ant-design react app 中使用 ant-design-pro 组件? [英] How to use ant-design-pro components in ant-design react app?

查看:57
本文介绍了如何在 ant-design react app 中使用 ant-design-pro 组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

解决方案

V4 参考

I have created react app with create-react-app and used ant-design components, as the project becomes bigger, I need to use some awesome components from ant-design-pro.

Is there any way to integrate ant-design-pro components in existing ant-design project?

I have tried to import and use @ant-design/pro-layout but didn't work for me.

解决方案

For V4 refer to Upgrade to V4, check Replace BasicLayout if you use @ant-design/pro-layout.

For single components use npm install ant-design-pro@2.3.2 and import components for your needs:

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

Demo:

这篇关于如何在 ant-design react app 中使用 ant-design-pro 组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆