corrade-nucleus-nucleons
/pack-rat/003_pack_rat/pack-rat/node_modules/bootstrap-table/docs/_i18n/zh-cn/getting-started/download.md |
@@ -0,0 +1,40 @@ |
# 下载 []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/getting-started/download.md) |
|
--- |
|
<p class="lead"> |
Bootstrap table (当前版本 v{{ site.current_version }}) 可以有几种快速入门的方法,每种适合不同技能等级的人使用,往下看哪种适合你。 |
</p> |
|
## 源码 |
|
包含了 css,JavaScript,多语言和扩展,以及文档。 |
|
<a href="{{ site.master_zip }}" class="btn btn-lg btn-outline" role="button">下载源码</a> |
|
## 克隆或者 Fork 通过 GitHub |
|
<a href="{{ site.repo }}" class="btn btn-lg btn-outline" role="button">通过 GitHub</a> |
|
## CDN |
|
[CDNJS](http://www.cdnjs.com/libraries/bootstrap-table) 或者 [bootcss](http://open.bootcss.com/bootstrap-table/) 提供了 CDN 来支持 Bootstrap table 的 CSS 和 JavaScript 文件链接。 |
|
```html |
<!-- Latest compiled and minified CSS --> |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/{{ site.current_version }}/bootstrap-table.min.css"> |
|
<!-- Latest compiled and minified JavaScript --> |
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/{{ site.current_version }}/bootstrap-table.min.js"></script> |
|
<!-- Latest compiled and minified Locales --> |
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/{{ site.current_version }}/locale/bootstrap-table-zh-CN.min.js"></script> |
``` |
|
## Bower |
|
通过 [Bower](http://bower.io/) 来安装和管理 Bootstrap table 的 CSS,JavaScript, 多语言和扩展。 |
|
```bash |
$ bower install bootstrap-table |
``` |
/pack-rat/003_pack_rat/pack-rat/node_modules/bootstrap-table/docs/_i18n/zh-cn/getting-started/grunt.md |
@@ -0,0 +1,38 @@ |
# 编译 CSS 和 JavaScript []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/getting-started/grunt.md) |
|
--- |
|
Bootstrap table 使用 [Grunt](http://gruntjs.com/) 来作为编译系统,可以用十分方便的方法来编译我们代码,或者文档等等。 |
|
## 安装 Grunt |
|
安装 Grunt,你必须先 [下载和安装 node.js](http://nodejs.org/download/) (包含 npm)。npm 是 [node 的包模块](http://npmjs.org/) 管理工具。 |
|
然后,我们使用命令行: |
|
1. 安装全局的 `grunt-cli`,使用 `npm install -g grunt-cli` 命令即可。 |
2. 进入到 `/bootstrap-table/` 的根目录,然后运行 `npm install`。npm 将通过查找 `package.json` 文件并自动安装这里所需要的依赖。 |
|
完成之后,你就可以运行一下的命令来编译的代码了。 |
|
## 可以用的 Grunt 命令 |
|
### `grunt dist` (编译 CSS 和 JavaScript) |
|
这里我们会生成 `/dist/` 文件夹。 As a Bootstrap user, this is normally the command you want. |
|
### `grunt test` (运行 tests) |
|
运行 [JSHint](http://jshint.com/) 来测试我们的代码。 |
|
### `grunt docs` (编译和测试文档) |
|
编译和测试 CSS,JavaScript,本地我们可以通过 `jekyll serve` 来运行我们的文档。 |
|
### `grunt` (编译所有并运行测试) |
|
压缩和扰乱 CSS 和 JavaScript,测试,编译文档等等。依赖 [Jekyll](http://jekyllrb.com/docs/installation/)。 |
|
## 遇到问题 |
|
如果你安装或运行依赖是遇到问题,首先删除 `/node_modules/` npm 生成的文件夹。然后,再运行一次 `npm install` 即可。 |
/pack-rat/003_pack_rat/pack-rat/node_modules/bootstrap-table/docs/_i18n/zh-cn/getting-started/usage.md |
@@ -0,0 +1,116 @@ |
# 使用 []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/getting-started/usage.md) |
|
--- |
|
引入 Bootstrap 库(假如你的项目还没有使用)和 `bootstrap-table.css` 到 head 标签下。 |
|
```html |
<link rel="stylesheet" href="bootstrap.min.css"> |
<link rel="stylesheet" href="bootstrap-table.css"> |
``` |
|
引入 jQuery 库,bootstrap 库(假如你的项目还没有使用)和 `bootstrap-table.js` 到 head 标签下或者在 body 标签关闭之前(一般建议这么做)。 |
|
```html |
<script src="jquery.min.js"></script> |
<script src="bootstrap.min.js"></script> |
<script src="bootstrap-table.js"></script> |
<-- put your locale files after bootstrap-table.js --> |
<script src="bootstrap-table-zh-CN.js"></script> |
``` |
|
--- |
|
通过 data 属性或者 JavaScript 来启用 Bootstrap Table 插件,显示丰富的功能。 |
|
## 通过 data 属性的方式 |
|
无需编写 JavaScript 启用 bootstrap table,我们对普通的 table 设置 `data-toggle="table"` 即可。 |
|
```html |
<table data-toggle="table"> |
<thead> |
<tr> |
<th>Item ID</th> |
<th>Item Name</th> |
<th>Item Price</th> |
</tr> |
</thead> |
<tbody> |
<tr> |
<td>1</td> |
<td>Item 1</td> |
<td>$1</td> |
</tr> |
<tr> |
<td>2</td> |
<td>Item 2</td> |
<td>$2</td> |
</tr> |
</tbody> |
</table> |
``` |
|
我们也可以通过设置远程的 url 如 `data-url="data1.json"` 来加载数据。 |
|
```html |
<table data-toggle="table" data-url="data1.json"> |
<thead> |
<tr> |
<th data-field="id">Item ID</th> |
<th data-field="name">Item Name</th> |
<th data-field="price">Item Price</th> |
</tr> |
</thead> |
</table> |
``` |
|
## 通过 JavaScript 的方式 |
|
通过表格 id 来启用 bootstrap table。 |
|
```html |
<table id="table"></table> |
``` |
|
```js |
$('#table').bootstrapTable({ |
columns: [{ |
field: 'id', |
title: 'Item ID' |
}, { |
field: 'name', |
title: 'Item Name' |
}, { |
field: 'price', |
title: 'Item Price' |
}], |
data: [{ |
id: 1, |
name: 'Item 1', |
price: '$1' |
}, { |
id: 2, |
name: 'Item 2', |
price: '$2' |
}] |
}); |
``` |
|
我们也可以通过设置远程的 url 如 `url: 'data1.json'` 来加载数据。 |
|
```js |
$('#table').bootstrapTable({ |
url: 'data1.json', |
columns: [{ |
field: 'id', |
title: 'Item ID' |
}, { |
field: 'name', |
title: 'Item Name' |
}, { |
field: 'price', |
title: 'Item Price' |
}, ] |
}); |
``` |
/pack-rat/003_pack_rat/pack-rat/node_modules/bootstrap-table/docs/_i18n/zh-cn/getting-started/whats-include.md |
@@ -0,0 +1,22 @@ |
# 包含什么 []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/getting-started/whats-include.md) |
|
--- |
|
下载的 Bootstrap table 源码包含了未压缩的 CSS,JavaScript,语言文件以及扩展,并且提供了压缩扰乱的 min 文件,当然也提供了我们的文档。更具体地说,主要包含了以下的文件: |
|
```bash |
bootstrap-table/ |
├── dist/ |
│ ├── extensions/ |
│ ├── locale/ |
│ ├── bootstrap-table.min.css |
│ └── bootstrap-table.min.js |
├── docs/ |
└── src/ |
├── extensions/ |
├── locale/ |
├── bootstrap-table.css |
└── bootstrap-table.js |
``` |
|
`src/`,`locale/` 和 `extensions/` 是我们的 CSS,JavaScript 的源码。`dist/`文件夹包含了所有`src/`下压缩并扰乱的文件。`docs/`文件夹包含了我们文档的源码。另外,我们提供了包信息,License 信息,和其他的信息。 |