首页 > 其他分享 >React后台管理系统05 引入UI组件库

React后台管理系统05 引入UI组件库

时间:2022-12-05 18:24:48浏览次数:38  
标签:npm ant 05 React 组件 UI install 引入

使用命令引入UI组件库 npm install antd --save

使用命令安装ant的图标库 npm install --save @ant-design/icons 注意这里的@后面是一个ant没有单词d!

配置Antd Design样式按需自动引入

npm install [email protected] -D使用该命令导入插件自动引入组件的样式,不用自己在写引入css样式,并且现在的版本antd里面也没有这个css样式文件了。

然后在vite.config.ts中进行配置:

plugins: [
    react(),
    styleImport({
      resolves: [
        AntdResolve()
      ]
    }),
  ],

 直接引入使用:

界面展示:

标签:npm,ant,05,React,组件,UI,install,引入
From: https://www.cnblogs.com/hg-blogs/p/16953085.html

相关文章