components.ts 919 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { VxeUI } from './ui'
  2. import { VxeColumn } from './column'
  3. import { VxeColgroup } from './colgroup'
  4. import { VxeGrid } from './grid'
  5. import { VxeTable } from './table'
  6. import { VxeToolbar } from './toolbar'
  7. import zhCN from './locale/lang/zh-CN'
  8. import type { VxeGlobalConfig } from '../types'
  9. const components = [
  10. VxeColumn,
  11. VxeColgroup,
  12. VxeGrid,
  13. VxeTable,
  14. VxeToolbar
  15. ]
  16. // 默认安装
  17. export function install (app: any, options?: VxeGlobalConfig) {
  18. VxeUI.setConfig(options)
  19. components.forEach(component => component.install(app))
  20. }
  21. // 保留兼容老版本
  22. if (!VxeUI.hasLanguage('zh-CN')) {
  23. const defaultLanguage = 'zh-CN'
  24. VxeUI.setI18n(defaultLanguage, zhCN)
  25. VxeUI.setLanguage(defaultLanguage)
  26. }
  27. VxeUI.setTheme('light')
  28. export * from './ui'
  29. // Components
  30. export * from './table'
  31. export * from './column'
  32. export * from './colgroup'
  33. export * from './grid'
  34. export * from './toolbar'