使用create-react-app创建的项目,要使用ant design。

1、首先进入项目根目录,yarn add antd.

2、在App.css引入 样式文件,@import '~antd/dist/antd.css';

3、需要是用的地方引入,import { Button, Icon } from 'antd';

然后代码里面直接使用即可

         <Button type="primary">按钮1</Button>
<Button type="dashed">按钮2</Button>
<Button type="danger">按钮3</Button>

不知道这个是不是按需加载,按照官方做法会报错,一时研究不明白,哎,,,先这样凑活用着。

在create-react-app里使用ant design的更多相关文章

  1. 深入 Create React App 核心概念

    本文差点难产而死.因为总结的过程中,多次怀疑本文是对官方文档的直接翻译和简单诺列:同时官方文档很全面,全范围的介绍无疑加深了写作的心智负担.但在最终的梳理中,发现走出了一条与众不同的路,于是坚持分享出 ...

  2. tap news:week5 0.0 create react app

    参考https://blog.csdn.net/qtfying/article/details/78665664 先创建文件夹 安装create react app 这个脚手架(facebook官方提 ...

  3. 使用create react app教程

    This project was bootstrapped with Create React App. Below you will find some information on how to ...

  4. 如何扩展 Create React App 的 Webpack 配置

    如何扩展 Create React App 的 Webpack 配置  原文地址https://zhaozhiming.github.io/blog/2018/01/08/create-react-a ...

  5. 在 .NET Core 5 中集成 Create React app

    翻译自 Camilo Reyes 2021年2月22日的文章 <Integrate Create React app with .NET Core 5> [1] Camilo Reyes ...

  6. 使用Facebook的create-react-app脚手架快速构建React开发环境(ant.design,redux......)

    编程领域中的“脚手架(Scaffolding)”指的是能够快速搭建项目“骨架”的一类工具.例如大多数的React项目都有src,public,webpack配置文件等等,而src目录中又包含compo ...

  7. 十九、React UI框架Antd(Ant Design)的使用——及react Antd的使用 button组件 Icon组件 Layout组件 DatePicker日期组件

    一.Antd(Ant Design)的使用:引入全部Css样式 1.1 antd官网: https://ant.design/docs/react/introduce-cn 1.2 React中使用A ...

  8. Create React App

    Facebook开源了React前端框架(MIT Licence),也同时提供了React脚手架 - create-react-app. create-react-app遵循约定优于配置(Coc)的原 ...

  9. Create React App 安装less 报错

    执行npm run eject 暴露模块 安装 npm i  less less-loader -D 1.打开 react app 的 webpack.config.js const sassRege ...

随机推荐

  1. Charles断点调试

  2. django ORM多对多操作

    创建多对多: 方式一:自定义关系表 class Host(models.Model): nid = models.AutoField(primary_key=True) hostname = mode ...

  3. php7 date函数警告去除

    在代码头上添加 date_default_timezone_set("PRC");

  4. Hello 2019

    2019也要创造价值! 热爱生活!

  5. java.lang.IllegalArgumentException: No enum constant org.apache.ws.commons.schema.XmlSchemaForm.

    一次系统断电维护之后,apache cxf 的 web service 接口调用一直报错: java.lang.IllegalArgumentException: No enum constant o ...

  6. docker18.09.5 Dockerfile文件编写

    Dockerfile命令详解(超全版本)  https://www.cnblogs.com/dazhoushuoceshi/p/7066041.html 案例1 dockerfile文件内容: FRO ...

  7. centos7 Ruby环境变量配置

    ruby安装参考博客:https://blog.csdn.net/yelllowcong/article/details/78362370  (Redis之集群redis-trib.rb环境的搭建-y ...

  8. 【算法习题】正整数数组中和为sum的任意个数的组合数

    1.递归实现(参考:https://blog.csdn.net/hit_lk/article/details/53967627) public class Test { @org.junit.Test ...

  9. Windows下安装MySQL8

    转自:https://blog.csdn.net/star_in_shy/article/details/82691330  感谢! 一.MySQL官网下载 (一)MySQL下载地址:https:// ...

  10. 前端面试题目汇总摘录(JS 基础篇)

    JS 基础 JavaScript 的 typeof 返回那些数据类型 object number function boolean undefined string typeof null; // o ...