1 | import store from './store/store'
|
2 | import ZCanvas from './components/z-canvas.vue'
|
3 | import ZView from './components/z-view.vue'
|
4 | import ZViewList from './components/z-list.vue'
|
5 | import ZSpot from './components/z-spot.vue'
|
6 | import ZDialog from './components/z-dialog.vue'
|
7 |
|
8 | const zircle = {
|
9 | install (Vue) {
|
10 | Object.defineProperty(Vue.prototype, '$zircle', {
|
11 | get () {
|
12 | return store.actions
|
13 | }
|
14 | })
|
15 | Vue.component('z-canvas', ZCanvas)
|
16 | Vue.component('z-view', ZView)
|
17 | Vue.component('z-list', ZViewList)
|
18 | Vue.component('z-spot', ZSpot)
|
19 | Vue.component('z-dialog', ZDialog)
|
20 | }
|
21 | }
|
22 |
|
23 | let GlobalVue = null
|
24 | if (typeof window !== 'undefined') {
|
25 | GlobalVue = window.Vue
|
26 | } else if (typeof global !== 'undefined') {
|
27 | GlobalVue = global.Vue
|
28 | }
|
29 | if (GlobalVue) {
|
30 | GlobalVue.use(zircle)
|
31 | }
|
32 |
|
33 | export default zircle
|