refactor: 系统管理页面重构和ts类型声明优化
Former-commit-id: 40263bbb072596ada41ef33d9170841e7e66cd01
This commit is contained in:
14
src/main.ts
14
src/main.ts
@@ -9,7 +9,7 @@ import 'element-plus/theme-chalk/index.css';
|
||||
import Pagination from '@/components/Pagination/index.vue';
|
||||
import '@/permission';
|
||||
|
||||
import 'default-passive-events'
|
||||
import 'default-passive-events';
|
||||
|
||||
// 引入svg注册脚本
|
||||
import 'virtual:svg-icons-register';
|
||||
@@ -21,25 +21,25 @@ import i18n from '@/lang/index';
|
||||
import '@/styles/index.scss';
|
||||
|
||||
// 根据字典编码获取字典列表全局方法
|
||||
import { listDictsByCode } from '@/api/system/dict';
|
||||
import { getDictItemsByTypeCode } from '@/api/system/dict';
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
// 自定义指令
|
||||
import * as directive from '@/directive';
|
||||
|
||||
Object.keys(directive).forEach(key => {
|
||||
Object.keys(directive).forEach((key) => {
|
||||
app.directive(key, (directive as { [key: string]: Directive })[key]);
|
||||
});
|
||||
|
||||
// 全局方法
|
||||
app.config.globalProperties.$listDictsByCode = listDictsByCode;
|
||||
app.config.globalProperties.$getDictItemsByTypeCode = getDictItemsByTypeCode;
|
||||
|
||||
// 注册全局组件
|
||||
app
|
||||
.component('Pagination', Pagination)
|
||||
.use(createPinia() as any)
|
||||
.use(router as any)
|
||||
.use(createPinia())
|
||||
.use(router)
|
||||
.use(ElementPlus)
|
||||
.use(i18n as any)
|
||||
.use(i18n)
|
||||
.mount('#app');
|
||||
|
||||
Reference in New Issue
Block a user