This repository was archived by the owner on Apr 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 10
10
[ Online examples] ( https://OneWayTech.github.io/vue2-datatable/examples/dist )
11
11
12
12
[ npm-url ] : https://www.npmjs.com/package/vue2-datatable-component
13
- [ npm-v-img ] : http ://img.shields.io/npm/v/vue2-datatable-component.svg
14
- [ npm-dl-img ] : http ://img.shields.io/npm/dm/vue2-datatable-component.svg
13
+ [ npm-v-img ] : https ://img.shields.io/npm/v/vue2-datatable-component.svg
14
+ [ npm-dl-img ] : https ://img.shields.io/npm/dm/vue2-datatable-component.svg
Original file line number Diff line number Diff line change 6
6
[ The best Datatable for Vue.js 2.x which never sucks ↓] ( README )
7
7
8
8
[ npm-url ] : https://www.npmjs.com/package/vue2-datatable-component
9
- [ npm-v-img ] : http ://img.shields.io/npm/v/vue2-datatable-component.svg
10
- [ npm-dl-img ] : http ://img.shields.io/npm/dm/vue2-datatable-component.svg
9
+ [ npm-v-img ] : https ://img.shields.io/npm/v/vue2-datatable-component.svg
10
+ [ npm-dl-img ] : https ://img.shields.io/npm/dm/vue2-datatable-component.svg
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ Wow, it's just a normal object!
42
42
Copy and paste from [ ` src/index.js ` ] ( https://github.com/OneWayTech/vue2-datatable/blob/master/src/index.js ) :
43
43
44
44
``` js
45
- module . exports = {
45
+ var Datatable = {
46
46
install : function (Vue , options ) {
47
47
var locale = options && options .locale || {};
48
48
@@ -54,6 +54,12 @@ module.exports = {
54
54
Vue .component (' Datatable' , require (' ./Datatable.vue' ));
55
55
}
56
56
};
57
+
58
+ if (typeof window !== ' undefined' && window .Vue ) {
59
+ window .Vue .use (Datatable)
60
+ }
61
+
62
+ module .exports = Datatable;
57
63
```
58
64
59
65
Apply to [ ` src/LimitSelect.vue ` ] ( https://github.com/OneWayTech/vue2-datatable/blob/master/src/LimitSelect.vue ) :
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ module.exports = {
42
42
本组件采用的是最简单的方案(见 [ ` src/index.js ` ] ( https://github.com/OneWayTech/vue2-datatable/blob/master/src/index.js ) ):
43
43
44
44
``` js
45
- module . exports = {
45
+ var Datatable = {
46
46
install : function (Vue , options ) {
47
47
var locale = options && options .locale || {};
48
48
@@ -51,9 +51,15 @@ module.exports = {
51
51
return locale[srcTxt] || srcTxt;
52
52
};
53
53
54
- Vue .component (' Datatable' , require (' ./src/ Datatable.vue' ));
54
+ Vue .component (' Datatable' , require (' ./Datatable.vue' ));
55
55
}
56
56
};
57
+
58
+ if (typeof window !== ' undefined' && window .Vue ) {
59
+ window .Vue .use (Datatable)
60
+ }
61
+
62
+ module .exports = Datatable;
57
63
```
58
64
59
65
模板中是这样操作(以 [ ` src/LimitSelect.vue ` ] ( https://github.com/OneWayTech/vue2-datatable/blob/master/src/LimitSelect.vue ) 为例):
You can’t perform that action at this time.
0 commit comments