2015-07-03 18:06:47 +08:00
|
|
|
|
# 下载
|
2015-05-09 18:52:17 +08:00
|
|
|
|
|
2015-07-05 15:43:07 +08:00
|
|
|
|
- category: 入门
|
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-07-06 15:51:26 +08:00
|
|
|
|
可以直接下载文件或使用 npm 进行安装。
|
|
|
|
|
|
2015-07-04 16:20:50 +08:00
|
|
|
|
## 直接下载
|
|
|
|
|
|
2015-07-21 17:11:49 +08:00
|
|
|
|
- **稳定版** <span class="versions" id="stable-version"></span>
|
|
|
|
|
|
|
|
|
|
<a id="stable-link" href="" target="_blank">下载</a>
|
|
|
|
|
|
2015-07-21 12:14:08 +08:00
|
|
|
|
- **开发版** <span class="versions" id="latest-version"></span>
|
2015-07-04 16:20:50 +08:00
|
|
|
|
|
2015-07-21 17:55:14 +08:00
|
|
|
|
开发版并不稳定,随时可能变更。
|
|
|
|
|
|
2015-07-05 23:38:13 +08:00
|
|
|
|
<ul id="latest-links">
|
|
|
|
|
<li>
|
|
|
|
|
<a href="http://ant.design/dist/antd.js">antd.js</a>
|
|
|
|
|
</li>
|
2015-07-21 17:55:14 +08:00
|
|
|
|
<li>
|
|
|
|
|
<a href="http://ant.design/dist/antd.min.js">antd.min.js</a>
|
|
|
|
|
</li>
|
2015-07-05 23:38:13 +08:00
|
|
|
|
<li>
|
|
|
|
|
<a href="http://ant.design/dist/antd.css">antd.css</a>
|
|
|
|
|
</li>
|
2015-07-21 17:55:14 +08:00
|
|
|
|
<li>
|
|
|
|
|
<a href="http://ant.design/dist/antd.min.css">antd.min.css</a>
|
|
|
|
|
</li>
|
2015-07-05 23:38:13 +08:00
|
|
|
|
</ul>
|
2015-07-04 16:20:50 +08:00
|
|
|
|
|
2015-07-05 23:38:13 +08:00
|
|
|
|
- **历史版本**:https://github.com/ant-design/ant-design/releases
|
2015-07-04 16:20:50 +08:00
|
|
|
|
|
|
|
|
|
## npm
|
|
|
|
|
|
2015-07-06 15:53:38 +08:00
|
|
|
|
**我们推荐使用 npm 的方式进行开发**,这样可以享受整个生态圈和工具链带来的诸多好处。
|
2015-07-06 15:51:26 +08:00
|
|
|
|
|
2015-07-06 14:44:03 +08:00
|
|
|
|
[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd)
|
|
|
|
|
|
2015-07-04 16:31:48 +08:00
|
|
|
|
可以通过 npm 直接安装到本地,使用 `require` 或 `import` 进行引用。
|
|
|
|
|
|
2015-07-04 16:20:50 +08:00
|
|
|
|
```bash
|
|
|
|
|
$ npm install antd --save
|
|
|
|
|
```
|
2015-07-05 23:38:13 +08:00
|
|
|
|
|
2015-08-11 21:07:49 +08:00
|
|
|
|
安装最新的开发版本:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
$ npm install antd@beta --save
|
|
|
|
|
```
|
|
|
|
|
|
2015-07-06 15:51:26 +08:00
|
|
|
|
## 开发工具
|
|
|
|
|
|
|
|
|
|
Ant Design 提供了开发构建的命令行工具,可以安装到全局直接使用:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
$ npm install antd-bin -g
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
或者安装到仓库下,使用 `package.json` 的 `scripts` 字段来配置命令:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
$ npm install antd-bin --save-dev
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
"scripts": {
|
|
|
|
|
"dev": "antd server",
|
|
|
|
|
"build": "antd build"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
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);
|
|
|
|
|
$('#latest-links a').each(function(i, item) {
|
2015-07-05 23:40:24 +08:00
|
|
|
|
$(item).attr('href', $(item).attr('href').replace('dist/antd', 'dist/antd-' + antdVersion.latest));
|
2015-07-05 23:38:13 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (antdVersion.stable) {
|
|
|
|
|
$('#stable-version').html(antdVersion.stable);
|
2015-07-21 12:14:08 +08:00
|
|
|
|
$('#stable-link').attr('href', 'https://github.com/ant-design/ant-design/releases/tag/' + antdVersion.stable);
|
2015-07-05 23:38:13 +08:00
|
|
|
|
} else {
|
|
|
|
|
$('#stable-version').html('暂无');
|
2015-07-21 12:14:08 +08:00
|
|
|
|
$('#stable-link').hide();
|
2015-07-05 23:38:13 +08:00
|
|
|
|
}
|
|
|
|
|
</script>
|