2015-10-27 14:26:21 +08:00
|
|
|
|
# 安装
|
2015-05-09 18:52:17 +08:00
|
|
|
|
|
2015-11-19 21:34:05 +08:00
|
|
|
|
- category: 2
|
2015-07-03 18:06:47 +08:00
|
|
|
|
- order: 2
|
2015-05-09 18:52:17 +08:00
|
|
|
|
|
2015-06-04 17:56:09 +08:00
|
|
|
|
---
|
2015-05-09 18:52:17 +08:00
|
|
|
|
|
2015-10-27 14:26:21 +08:00
|
|
|
|
## 使用 npm 安装
|
2015-07-04 16:20:50 +08:00
|
|
|
|
|
2015-09-15 01:05:14 +08:00
|
|
|
|
**我们推荐使用 npm 的方式进行开发**,不仅可在开发环境轻松调试,也可放心地在生产环境打包部署使用,享受整个生态圈和工具链带来的诸多好处。
|
2015-07-06 15:51:26 +08:00
|
|
|
|
|
2015-12-16 15:14:42 +08:00
|
|
|
|
可以通过 npm 直接安装到项目中,使用 `import` 或 `require` 进行引用。
|
2015-07-04 16:31:48 +08:00
|
|
|
|
|
2015-10-27 14:26:21 +08:00
|
|
|
|
稳定版 <span class="versions" id="stable-version"></span>:
|
|
|
|
|
|
2015-09-09 10:25:58 +08:00
|
|
|
|
[![npm package](http://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd)
|
2015-09-08 12:15:00 +08:00
|
|
|
|
|
2015-07-04 16:20:50 +08:00
|
|
|
|
```bash
|
|
|
|
|
$ npm install antd --save
|
|
|
|
|
```
|
2015-07-05 23:38:13 +08:00
|
|
|
|
|
2015-10-27 14:26:21 +08:00
|
|
|
|
安装最新的开发版本 <span class="versions" id="latest-version"></span>:
|
2015-08-11 21:07:49 +08:00
|
|
|
|
|
2015-09-08 12:15:00 +08:00
|
|
|
|
[![](https://cnpmjs.org/badge/v/antd.svg?&tag=beta&subject=npm)](https://www.npmjs.org/package/antd)
|
|
|
|
|
|
2015-08-11 21:07:49 +08:00
|
|
|
|
```bash
|
|
|
|
|
$ npm install antd@beta --save
|
|
|
|
|
```
|
|
|
|
|
|
2015-10-27 14:26:21 +08:00
|
|
|
|
> **历史版本**:https://github.com/ant-design/ant-design/releases
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 开发工具
|
2015-07-06 15:51:26 +08:00
|
|
|
|
|
2015-12-16 15:14:42 +08:00
|
|
|
|
我们提供了 React 前端应用开发的 [脚手架工具](https://github.com/ant-design/antd-init),可以安装到全局直接使用。
|
2015-07-06 15:51:26 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
2015-12-16 15:14:42 +08:00
|
|
|
|
$ npm install antd-init -g
|
2015-07-06 15:51:26 +08:00
|
|
|
|
```
|
|
|
|
|
|
2015-12-16 15:14:42 +08:00
|
|
|
|
在空目录运行 `antd-init` 可以初始化一个 antd 的前端应用。
|
2015-07-06 15:51:26 +08:00
|
|
|
|
|
2015-12-16 15:14:42 +08:00
|
|
|
|
> 更多 [使用方式](https://github.com/ant-tool/xtool/)。
|
2015-09-15 01:05:14 +08:00
|
|
|
|
|
2015-07-05 23:38:13 +08:00
|
|
|
|
<style>
|
|
|
|
|
.versions {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #C05B4D;
|
|
|
|
|
font-family: Consolas;
|
|
|
|
|
margin-left: 0.3em;
|
|
|
|
|
background: #FFF1E7;
|
|
|
|
|
padding: 2px 5px;
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
$('#latest-version').html(antdVersion.latest);
|
|
|
|
|
|
|
|
|
|
if (antdVersion.stable) {
|
|
|
|
|
$('#stable-version').html(antdVersion.stable);
|
|
|
|
|
} else {
|
|
|
|
|
$('#stable-version').html('暂无');
|
|
|
|
|
}
|
|
|
|
|
</script>
|