123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import 'babel-polyfill';
- //#pragma warning(disable:18)
- import { createApp, createVNode } from 'vue'
- import App from './App.vue'
- import router from './router/index' //路由
- //element-plus 组件相关
- import ElementPlus from 'element-plus'
- import 'element-plus/dist/index.css'
- import zhCn from 'element-plus/es/locale/lang/zh-cn'
- import * as EleIcons from '@element-plus/icons-vue'
- //fragment
- import Fragment from 'vue-fragment'
- //全局样式
- import './style/main.css'
- import { isValidKey } from '@/utils/utils'
- //请求
- import * as request from '@/api/index'
- //导出表格
- //import JsonExcel from 'vue-json-excel'
-
- import itemIoc from '@/layout/components/ItemIcon.vue'
-
- const app = createApp(App)
- //app.component('downloadExcel', JsonExcel)
- //全局注册请求
- app.config.globalProperties.$request = request;
- app.use(router)
- .use(Fragment.Plugin)
- .use(ElementPlus, { // 使用element-plus
- locale: zhCn,
- })
-
- //全局图标组件
- for (const name in EleIcons) {
- if (isValidKey(name, EleIcons)) {
- app.component(name, EleIcons[name]) //添加图标组件
- }
- }
-
- // 下面为全局注册图标组件
- // 创建Icon组件
- const Icon: any = (props: { icon: string }) => {
- const { icon } = props
- return createVNode(EleIcons[icon as keyof typeof EleIcons])
- }
- // 注册Icon组件
- app.component('icon-tab', Icon)
- app.component('item-ioc', itemIoc)
-
- app.mount('#app')
|