-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
vue-list-picker.js
37 lines (29 loc) · 933 Bytes
/
vue-list-picker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Import vue component
import VueListPicker from './src/components/VueListPicker.vue'
// install function executed by Vue.use()
const install = function (Vue) {
if (install.installed) return
install.installed = true
Vue.component('VueListPicker', VueListPicker)
}
// Create module definition for Vue.use()
const plugin = { install }
// To auto-install when vue is found
// eslint-disable-next-line no-redeclare
/* global window, global */
let GlobalVue = null
if (typeof window !== 'undefined') {
GlobalVue = window.Vue
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue
}
if (GlobalVue) {
GlobalVue.use(plugin)
}
// Inject install function into component - allows component
// to be registered via Vue.use() as well as Vue.component()
VueListPicker.install = install
// Export component by default
export default VueListPicker
// Export single (backwards compatibility)
export { VueListPicker }