-
Notifications
You must be signed in to change notification settings - Fork 172
/
index.js
54 lines (47 loc) · 1.17 KB
/
index.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* 自动生成者来着 './build/build-entry.js' */
import Button from './packages/button/index.js';
import Icon from './packages/icon/index.js';
import UTableColumn from './packages/u-table-column/index.js';
import UTable from './packages/u-table/index.js';
import UxGrid from './packages/ux-grid/index.js';
import UxTableColumn from './packages/ux-table-column/index.js';
import locale from 'umy-ui/tools/locale';
// 引入u-table的locale
import tableLocale from 'umy-table/lib/locale'
const components = [
Button,
Icon,
UTableColumn,
UTable,
UxGrid,
UxTableColumn
];
const install = function(Vue, opts = {}) {
locale.use(opts.locale);
locale.i18n(opts.i18n);
// 设置u-table的语言
tableLocale.use(opts.locale);
components.forEach(component => {
Vue.component(component.name, component);
});
Vue.prototype.$UMYUI = {
size: opts.size || '',
zIndex: opts.zIndex || 2000
};
};
/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
}
export default {
version: '1.1.6',
locale: locale.use,
i18n: locale.i18n,
install,
Button,
Icon,
UTableColumn,
UTable,
UxGrid,
UxTableColumn
};