-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
vue-paycard.js
39 lines (31 loc) · 914 Bytes
/
vue-paycard.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
38
39
// Import vue component
import VuePaycard from './src/components/VuePaycard.vue'
// install function executed by Vue.use()
const install = function (Vue) {
if (install.installed) return
install.installed = true
Vue.component('VuePaycard', VuePaycard)
}
// 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()
VuePaycard.install = install
// Export component by default
export default VuePaycard
// Export single (backwards compatibility)
export { VuePaycard }