-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.ts
59 lines (52 loc) · 1.32 KB
/
index.ts
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import VueCompositionAPI from '@vue/composition-api'
import ElementUI from 'element-ui'
import { FaFormDialog, FaImage, FaImageUpload, FaPopButton, FaPopSwitch, FaSelect } from 'faim'
import Vue from 'vue'
import App from './App.vue'
import YourComponent from './YourComponent.vue'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(VueCompositionAPI)
Vue.use(ElementUI)
Vue.use(FaFormDialog, {
// 全局配置
width: `${window.outerWidth / 2}px`,
})
Vue.use(FaImage, {
// 全局配置
})
Vue.use(FaImageUpload, {
// 全局配置
})
Vue.use(FaPopButton, {
// 全局配置
})
Vue.use(FaPopSwitch, {
// 全局配置
})
Vue.use(FaSelect, {
// 全局配置
})
Vue.use(YourComponent, {
// Global Prop
'title': 'Global Title',
// Global Attr
'data': [
{ key: 1, label: 'Global Option 1' },
{ key: 2, label: 'Global Option 2' },
],
// Global Listener
'@left-check-change': function () {
console.log('Global LeftCheckChange')
},
// Global Hook
'@hook:mounted': function () {
console.log('Global Mounted')
},
// Global Slot
'#left-footer': () => ({ render: h => h('span', undefined, 'Global Slot') }),
// Global Scoped Slot
'#default': ({ option }) => ({ render: h => h('span', undefined, `${option.label} (From Global Scoped Slot)`) }),
})
new Vue({
render: h => h(App),
}).$mount('#app')