Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Commit ce8d9d4

Browse files
author
Ken Berkeley
committed
[unit test] add test/ and travis CI
1 parent 4161ac0 commit ce8d9d4

File tree

15 files changed

+245
-25
lines changed

15 files changed

+245
-25
lines changed

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// http://eslint.org/docs/user-guide/configuring
22
{
3+
parserOptions: {
4+
ecmaVersion: 2017 // support async/await
5+
},
36
globals: {
47
$: false // for jQuery
58
},

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sudo: false
2+
language: node_js
3+
node_js: stable

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![npm version][npm-v-img]][npm-url]
44
[![npm download][npm-dl-img]][npm-url]
5+
[![build][build-img]][build-url]
56

67
> The best Datatable for Vue.js 2.x which never sucks
78
> `npm i -S vue2-datatable-component`
@@ -12,3 +13,5 @@
1213
[npm-url]: https://www.npmjs.com/package/vue2-datatable-component
1314
[npm-v-img]: https://img.shields.io/npm/v/vue2-datatable-component.svg
1415
[npm-dl-img]: https://img.shields.io/npm/dm/vue2-datatable-component.svg
16+
[build-img]: https://travis-ci.org/onewaytech/vue-datatable-component.svg?branch=master
17+
[build-url]: https://travis-ci.org/onewaytech/vue-datatable-component

dist/min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/_coverpage.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
[![npm version][npm-v-img]][npm-url]
44
[![npm download][npm-dl-img]][npm-url]
5+
[![build][build-img]][build-url]
56

67
[The best Datatable for Vue.js 2.x which never sucks ↓](README)
78

89
[npm-url]: https://www.npmjs.com/package/vue2-datatable-component
910
[npm-v-img]: https://img.shields.io/npm/v/vue2-datatable-component.svg
1011
[npm-dl-img]: https://img.shields.io/npm/dm/vue2-datatable-component.svg
12+
[build-img]: https://travis-ci.org/onewaytech/vue-datatable-component.svg?branch=master
13+
[build-url]: https://travis-ci.org/onewaytech/vue-datatable-component

doc/en/i18n.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ Apply to [`src/LimitSelect.vue`](https://github.com/OneWayTech/vue2-datatable/bl
6666
<template>
6767
<label name="LimitSelect">
6868
{{ $i18nForDatatable('show') }}
69-
<select class="form-control input-sm -limit-select" v-model="limit">
69+
<select class="form-control input-sm -limit-select" v-model="query.limit"
70+
@change="query.offset = 0 /* reset to the first page */">
7071
<option v-for="i in options" :value="i">{{ i }}</option>
7172
</select>
7273
{{ $i18nForDatatable('items per page') }}
7374
</label>
7475
</template>
75-
...
7676
```
7777

7878
Easy, right?

doc/zh-cn/i18n.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ export default Datatable
6666
<template>
6767
<label name="LimitSelect">
6868
{{ $i18nForDatatable('show') }}
69-
<select class="form-control input-sm -limit-select" v-model="limit">
69+
<select class="form-control input-sm -limit-select" v-model="query.limit"
70+
@change="query.offset = 0 /* reset to the first page */">
7071
<option v-for="i in options" :value="i">{{ i }}</option>
7172
</select>
7273
{{ $i18nForDatatable('items per page') }}
7374
</label>
7475
</template>
75-
...
7676
```
7777

7878
很简单吧?
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
<script src="//unpkg.com/jquery@2.1.4/dist/jquery.min.js"></script>
1414
<script src="//unpkg.com/bootstrap@3.3.5/dist/js/bootstrap.min.js"></script>
15-
<script type="text/javascript" src="client.e57b87a6.js"></script></body>
15+
<script type="text/javascript" src="client.05dc68df.js"></script></body>
1616
</html>

examples/src/_mockData/dataSource.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const total = 120 // how many rows to generate
66
const getRandomUid = () => Random.integer(1, total)
77

88
const users = Array(total).fill().map((item, idx) => ({
9-
uid: idx,
9+
uid: idx + 1,
1010
name: Random.name(),
11-
age: Random.integer(0, 100),
11+
age: Random.integer(1, 100),
1212
email: Random.email().substr(0, 22),
1313
friends: without(
1414
uniq(Array(getRandomUid()).fill().map(() => getRandomUid())),

0 commit comments

Comments
 (0)