Skip to content

Commit b2b09c6

Browse files
committed
Merge branch 'master' into test_tools
2 parents a012d95 + 969970d commit b2b09c6

File tree

11 files changed

+83
-14
lines changed

11 files changed

+83
-14
lines changed

build/release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
2424
echo "revising version in doc..."
2525
sed -i '' "s/vue-data-tables@\(.*\)\/dist/vue-data-tables@$VERSION\/dist/g" docs/index.html
2626
sed -i '' "s/<small>\(.*\)<\/small>/<small>$VERSION<\/small>/" docs/_coverpage.md
27+
sed -i '' "s/<small>\(.*\)<\/small>/<small>$VERSION<\/small>/" docs/en-us/_coverpage.md
28+
sed -i '' "s/<small>\(.*\)<\/small>/<small>$VERSION<\/small>/" docs/zh-cn/_coverpage.md
2729

2830
# commit
2931
git add docs

build/webpack.test.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const webpackConfig = merge(baseWebpackConfig, {
1010
mode: 'development',
1111
// use inline sourcemap for karma-sourcemap-loader
1212
module: {
13-
rules: utils.styleLoaders({ sourceMap: true, usePostCSS: true })
13+
rules: utils.styleLoaders()
1414
},
1515
devtool: '#inline-source-map',
1616
resolveLoader: {

docs/en-us/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](../_media/icon.svg)
22

3-
# vue-data-tables <small>3.3.7</small>
3+
# vue-data-tables <small>3.4.0</small>
44

55
> A simple, customizable and pageable table, based on vue2 and element-ui
66

docs/en-us/actionBar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Tool Bar
2-
In the version before `3.4`, `vue-data-tables` provides a default tool bar with some filter tools, like checkbox and search. In practice, the tool bar is entirely different from project to project, most of the time, the default tool bar is useless. To decrease the complexity of this library, the default tool bar is removed from `3.4`. If you need tool bar, just implement yourself according to your project requirement.
2+
In the version before `3.4`, `vue-data-tables` provides a default tool bar with some filter tools, like checkbox and search. In practice, the tool bar is entirely different from project to project, most of the time, the default tool bar is useless. To decrease the complexity of this library, the default tool bar is removed from version `3.4`. If you need tool bar, just implement yourself according to your project requirement.
33

44
In the following example, we implement a tool bar, and leverage the [filters](en-us/filter.md) property of `vue-data-tables` to make table filter work.
55

docs/en-us/quickStart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ locale.use(lang)
3636

3737
### import bundled vue-data-tables (recommended and straightforward)
3838
```js
39-
// import DataTables and DataTableServer separately
40-
import { DataTables, DataTableServer } from 'vue-data-tables'
39+
// import DataTables and DataTablesServer separately
40+
import { DataTables, DataTablesServer } from 'vue-data-tables'
4141
Vue.use(DataTables)
4242

43-
// import DataTables and DataTableServer together
43+
// import DataTables and DataTablesServer together
4444
import VueDataTables from 'vue-data-tables'
4545
Vue.use(VueDataTables)
4646
```

docs/en-us/sort.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,41 @@
22

33
`sort` feature of `vue-data-tables` is based on the [customize sort](http://element.eleme.io/#/en-US/component/table#sorting) of `el-table`. Setting `sortable` prop of `el-table-column` to `custom` can enable customize sort of the column.
44

5-
> PS, Setting `sortable` to `true` can also work, but `vue-data-table` and embedded `el-table` both sort the data, which may cause performance downgrade.
5+
> PS: Setting `sortable` to `true` can also work, but `vue-data-table` and embedded `el-table` both sort the data, which may cause performance downgrade.
66
7-
`el-table` accepts `default-sort` prop to set default sort column and order. `vue-data-tables` can pass any props to embedded `el-table` by prop [table-props](en-us/basic.md?id=pass-props-to-the-embedded-el-table), so we can define `vue-data-tables`'s default sort by `:table-props='{ defaultSort: VALUE }'`.
7+
```html
8+
/*vue*/
9+
<desc>
10+
* `sortable="custom"` 很重要
11+
* `tableProps.defaultSort` 定义了默认的排序列
12+
</desc>
13+
<template>
14+
<data-tables
15+
:data='data'
16+
>
17+
<el-table-column v-for="title in titles"
18+
:prop="title.prop"
19+
:label="title.label"
20+
:key="title.label"
21+
sortable="custom">
22+
</el-table-column>
23+
</data-tables>
24+
</template>
25+
26+
<script>
27+
export default {
28+
data() {
29+
return {
30+
data,
31+
titles,
32+
}
33+
}
34+
}
35+
</script>
36+
```
37+
38+
## Default sort
39+
As mentioned in [previous section](en-us/basic.md?id=pass-props-to-the-embedded-el-table), `el-table` accepts `default-sort` prop to set default sort column and order. `vue-data-tables` can pass any props to embedded `el-table` by prop [table-props](en-us/basic.md?id=pass-props-to-the-embedded-el-table), so we can define `vue-data-tables`'s default sort by `:table-props='{ defaultSort: VALUE }'`.
840

941
```html
1042
/*vue*/

docs/zh-cn/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](../_media/icon.svg)
22

3-
# vue-data-tables <small>3.3.7</small>
3+
# vue-data-tables <small>3.4.0</small>
44

55
> 一个基于 Vue 和 element-ui 简单易用, 可定制的分页表格
66

docs/zh-cn/quickStart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ locale.use(lang)
3737

3838
### 引入打包之后的 vue-data-tables (推荐, 简单)
3939
```js
40-
// 分别导入 DataTables 和 DataTableServer
41-
import { DataTables, DataTableServer } from 'vue-data-tables'
40+
// 分别导入 DataTables 和 DataTablesServer
41+
import { DataTables, DataTablesServer } from 'vue-data-tables'
4242
Vue.use(DataTables)
4343

44-
// 同时使用 DataTables 和 DataTableServer
44+
// 同时使用 DataTables 和 DataTablesServer
4545
import VueDataTables from 'vue-data-tables'
4646
Vue.use(VueDataTables)
4747
```

docs/zh-cn/sort.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,41 @@
44

55
> 注意虽然把 `sortable` 属性为 `true` 也可以工作,但是此时 `vue-data-table` 和内置的 `el-table` 都会对数据进行排序,会影响表格的性能。
66
7-
我们可以通过 `el-table``default-sort` 属性来设置默认的排序列和方向。对于 `vue-data-tables` 来说所有的内置 `el-table` 的属性,都可以通过 [table-props](zh-cn/basic.md?id=传递-prop-给内置的-el-table) 来传递,所以我们可以通过 `:table-props='{ defaultSort: VALUE }'`, 来为 `vue-data-tables` 定义默认排序。
7+
8+
```html
9+
/*vue*/
10+
<desc>
11+
* `sortable="custom"` 很重要
12+
* `tableProps.defaultSort` 定义了默认的排序列
13+
</desc>
14+
<template>
15+
<data-tables
16+
:data='data'
17+
>
18+
<el-table-column v-for="title in titles"
19+
:prop="title.prop"
20+
:label="title.label"
21+
:key="title.label"
22+
sortable="custom">
23+
</el-table-column>
24+
</data-tables>
25+
</template>
26+
27+
<script>
28+
export default {
29+
data() {
30+
return {
31+
data,
32+
titles,
33+
}
34+
}
35+
}
36+
</script>
37+
```
38+
39+
## 默认排序
40+
41+
[前文](zh-cn/basic.md?id=传递-prop-给内置的-el-table)提到的,我们可以通过 `el-table``default-sort` 属性来设置默认的排序列和方向。对于 `vue-data-tables` 来说所有的内置 `el-table` 的属性,都可以通过 [table-props](zh-cn/basic.md?id=传递-prop-给内置的-el-table) 来传递,所以我们可以通过 `:table-props='{ defaultSort: VALUE }'`, 来为 `vue-data-tables` 定义默认排序。
842

943
```html
1044
/*vue*/

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"babel-plugin-jsx-v-model": "^2.0.3",
4444
"babel-plugin-lodash": "^3.3.2",
4545
"babel-plugin-syntax-jsx": "^6.18.0",
46-
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
4746
"babel-plugin-transform-runtime": "^6.22.0",
4847
"babel-plugin-transform-vue-jsx": "^3.7.0",
4948
"babel-plugin-vue-jsx-sync": "^0.0.5",

test/unit/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Vue.use(VueDataTables)
1111
chai.should() // Using Should style
1212
chai.use(sinonChai)
1313

14+
const isHeadlessChrome = /\bHeadlessChrome\//.test(navigator.userAgent)
15+
Vue.config.devtools = !isHeadlessChrome
1416
Vue.config.productionTip = false
1517
Vue.config.silent = true
1618

0 commit comments

Comments
 (0)