Skip to content

Commit 4af2116

Browse files
committedMar 28, 2018
Fixed plugin installation
1 parent 179b31e commit 4af2116

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed
 

‎index.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
11
import TinyPagination from './src/components/TinyPagination.vue'
22

33
const install = (Vue, opts ={}) => {
4-
if (install.installed) return
5-
install.installed = true
64
Vue.component('TinyPagination', TinyPagination)
75
}
86

9-
const plugin = {
10-
version: '0.2.1-beta.6',
11-
install,
12-
TinyPagination
7+
if (typeof window !== 'undefined' && window.Vue) {
8+
install(window.Vue)
139
}
1410

15-
let GlobalVue = null
16-
if (typeof window !== 'undefined') {
17-
GlobalVue = window.Vue
18-
} else if (typeof global !== 'undefined') {
19-
GlobalVue = global.Vue
20-
}
21-
if (GlobalVue) {
22-
GlobalVue.use(plugin)
11+
module.exports = {
12+
version: '0.2.1-beta.7',
13+
install,
14+
TinyPagination
2315
}
2416

25-
module.exports = plugin
2617
module.exports.default = module.exports

0 commit comments

Comments
 (0)