下面拓展一下Ant Design(UI组件库)的一下高级配置pa~~
链接参考:https://3x.ant.design/docs/react/use-with-create-react-app-cn
在create-react-app脚手架使用中,我们经常会全局引入一个组件库的样式
安装和初始化 一个项目
yarn create react-app antd-demo
自动初始化一个脚手架并安装 React 项目的各种必要依赖,如果在过程中出现网络问题,请尝试配置代理或使用其他 npm registry(要速度的同学可以配置个镜像哦)。
启动项目:
cd antd-demo
yarn start
此时浏览器会访问 http://localhost:3000/ ,看到 Welcome to React
的界面就算成功了。
接下来我们进行安装antd
yarn add antd
接下来修改src/App.js中的文件
import React, {Component} from 'react';
import {Button} from "antd";
import 'antd/d