-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.ts
65 lines (59 loc) · 1.45 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
60
61
62
63
64
65
import Vue from 'vue'
import { version } from './package.json'
import VForm from './packages/Form/index.vue'
import VTable from './packages/Table/index.vue'
import VAdaptivePage from './packages/adaptive-page'
// import VChart from './packages/Charts/index.vue'
import VDetail from './packages/detail'
import VDialog from './packages/dialog'
import VLayoutPage from './packages/layout-page'
import VLayoutPageItem from './packages/layout-page-item'
import VQueryCondition from './packages/query-condition'
import VSelect from './packages/select'
import VSelectTable from './packages/select-table'
import TTable from './packages/t-table'
import VTreeSelect from './packages/tree-select'
import './src/index.css'
// 存储组件列表
const components = [
VLayoutPage,
VSelect,
VSelectTable,
VTreeSelect,
VLayoutPageItem,
VForm,
VTable,
VQueryCondition,
VAdaptivePage,
VDetail,
TTable,
VDialog
]
const install = function(vue: typeof Vue, opts = {}) {
// 遍历注册全局组件
components.map(component => vue.component(component.name, component))
}
export {
TTable,
VAdaptivePage,
VDetail,
VDialog,
VForm,
VLayoutPage,
VLayoutPageItem,
VQueryCondition,
VSelect,
VSelectTable,
VTable,
VTreeSelect
}
/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue)
}
export default {
version,
...components,
// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
install
}