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 1010[ Online examples] ( https://OneWayTech.github.io/vue2-datatable/examples/dist )
1111
1212[ 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 66[ The best Datatable for Vue.js 2.x which never sucks ↓] ( README )
77
88[ 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!
4242Copy and paste from [ ` src/index.js ` ] ( https://github.com/OneWayTech/vue2-datatable/blob/master/src/index.js ) :
4343
4444``` js
45- module . exports = {
45+ var Datatable = {
4646 install : function (Vue , options ) {
4747 var locale = options && options .locale || {};
4848
@@ -54,6 +54,12 @@ module.exports = {
5454 Vue .component (' Datatable' , require (' ./Datatable.vue' ));
5555 }
5656};
57+
58+ if (typeof window !== ' undefined' && window .Vue ) {
59+ window .Vue .use (Datatable)
60+ }
61+
62+ module .exports = Datatable;
5763```
5864
5965Apply 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 = {
4242本组件采用的是最简单的方案(见 [ ` src/index.js ` ] ( https://github.com/OneWayTech/vue2-datatable/blob/master/src/index.js ) ):
4343
4444``` js
45- module . exports = {
45+ var Datatable = {
4646 install : function (Vue , options ) {
4747 var locale = options && options .locale || {};
4848
@@ -51,9 +51,15 @@ module.exports = {
5151 return locale[srcTxt] || srcTxt;
5252 };
5353
54- Vue .component (' Datatable' , require (' ./src/ Datatable.vue' ));
54+ Vue .component (' Datatable' , require (' ./Datatable.vue' ));
5555 }
5656};
57+
58+ if (typeof window !== ' undefined' && window .Vue ) {
59+ window .Vue .use (Datatable)
60+ }
61+
62+ module .exports = Datatable;
5763```
5864
5965模板中是这样操作(以 [ ` 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