React 指南

蚂蚁金服React框架 蚂蚁金服UI

在这里插入图片描述

第一步 创建一个新的React项目
How To Creat A New React App ?
You’ll need to have Node 8.10.0 or later

you may choose one of the following methods:

npx
npx create-react-app my-app
npm
npm init react-app my-app
Yarn
yarn create react-app my-app

then

cd my-app
npm start

Open http://localhost:3000 to view it in the browser.

It will create a directory called my-app inside the current folder.

my-app
├── README.md
├── node_modules
├── package.json
├── .gitignore
├── public
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
└── src
├── App.css
├── App.js
├── App.test.js
├── index.css
├── index.js
├── logo.svg
└── serviceWorker.js

Builds the app for production to the build folder.
npm run build
二 引入mock
Mock设置教程
三 路由
React-Router设置教程

React Router 安装命令

npm install -S react-router

在js中引入

import { Router } from 'react-router';

render(<Router/>, document.getElementById('app'));
四 使用UmiJS 快速构建项目
官方文档UmiJS

在这里插入图片描述

1.安装 umi
yarn global add umi # or npm install -g umi
2.通过 umi 脚手架构建一个项目
 yarn create umi
3.然后手动安装依赖
yarn
4. 通过 yarn start 启动本地开发
yarn start

如果顺利,在浏览器打开 http://localhost:8000 可看到界面

五 dva

引入dva管理数据

六 anti.design

官方文档Anti.Design

引入anti.design,使用组建快速构建UI界面

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值