mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 04:30:06 +08:00
docs: upgrade Getting Started with antd-init@2
This commit is contained in:
parent
e6c406a4b7
commit
681576d2c4
@ -45,7 +45,7 @@ A new project can be created using CLI tools.
|
||||
|
||||
```bash
|
||||
$ mkdir antd-demo && cd antd-demo
|
||||
$ antd-init --type plain-react
|
||||
$ antd-init
|
||||
```
|
||||
|
||||
`antd-init` will run `npm install` after a project is created. If it fails, you can run `npm install` by yourself.
|
||||
@ -55,7 +55,7 @@ $ antd-init --type plain-react
|
||||
By default, besides the scaffolding needed to start the development, a fully working Todo application is created.
|
||||
You may study this example later. For now, just follow this guide in order to get some experience working with the result of `antd-init`.
|
||||
|
||||
Replace the content of `src/entries/index.js` with the following code.
|
||||
Replace the content of `index.js` with the following code.
|
||||
As you can see, there is no difference between antd's components and usual React components.
|
||||
|
||||
```jsx
|
||||
@ -91,7 +91,7 @@ ReactDOM.render(<App />, document.getElementById('root'));
|
||||
|
||||
### 4. Development & Debugging
|
||||
|
||||
Run your project and visit http://127.0.0.1:8989
|
||||
Run your project and visit http://127.0.0.1:8000
|
||||
|
||||
```bash
|
||||
$ npm start
|
||||
|
@ -44,7 +44,7 @@ $ npm install antd-init -g
|
||||
|
||||
```bash
|
||||
$ mkdir antd-demo && cd antd-demo
|
||||
$ antd-init --type plain-react
|
||||
$ antd-init
|
||||
```
|
||||
|
||||
antd-init 会自动安装 npm 依赖,若有问题则可自行安装。
|
||||
@ -55,7 +55,7 @@ antd-init 会自动安装 npm 依赖,若有问题则可自行安装。
|
||||
|
||||
脚手架会生成一个 Todo 应用实例(一个很有参考价值的 React 上手示例),先不管它,我们用来测试组件。
|
||||
|
||||
直接用下面的代码替换 `src/entries/index.js` 的内容,用 React 的方式直接使用 antd 组件。
|
||||
直接用下面的代码替换 `index.js` 的内容,用 React 的方式直接使用 antd 组件。
|
||||
|
||||
```jsx
|
||||
import React from 'react';
|
||||
@ -90,7 +90,7 @@ ReactDOM.render(<App />, document.getElementById('root'));
|
||||
|
||||
### 4. 开发调试
|
||||
|
||||
一键启动调试,访问 http://127.0.0.1:8989 查看效果。
|
||||
一键启动调试,访问 http://127.0.0.1:8000 查看效果。
|
||||
|
||||
```bash
|
||||
$ npm start
|
||||
|
Loading…
Reference in New Issue
Block a user