From a7844be9b320093b1e181268872e1cefbd0e07ce Mon Sep 17 00:00:00 2001 From: SaarHV Date: Wed, 21 Dec 2022 20:36:08 +0800 Subject: [PATCH 1/4] Add mitt component --- package.json | 1 + src/main.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/package.json b/package.json index 720169c..fa77db4 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "element-plus": "^v1.0.1-beta.17", "axios": "^0.27.2", "js-cookie": "^3.0.1", + "mitt": "^3.0.0", "pinia": "^2.0.14", "sortablejs": "^1.10.2", "vue": "^3.2.36", diff --git a/src/main.ts b/src/main.ts index f8a0111..d3b89d5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,8 +6,12 @@ import router from './router' import ElementPlus from 'element-plus' import 'element-plus/lib/theme-chalk/index.css' import '/@/theme/index.scss' +import mitt from 'mitt'; + import { locale } from 'element-plus' const app = createApp(App); app.use(pinia).use(router).use(ElementPlus, { locale }).mount('#app') + +app.config.globalProperties.mittBus = mitt(); -- Gitee From 2390dc647313dc62aecb54f61809efa279693ecd Mon Sep 17 00:00:00 2001 From: SaarHV Date: Wed, 21 Dec 2022 20:37:56 +0800 Subject: [PATCH 2/4] Update the import of element-plus' style --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index d3b89d5..47c2967 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,7 @@ import App from './App.vue' import router from './router' import ElementPlus from 'element-plus' -import 'element-plus/lib/theme-chalk/index.css' +import 'element-plus/dist/index.css'; import '/@/theme/index.scss' import mitt from 'mitt'; -- Gitee From 7450899a67a516bf8c78ccbf64b5517f38082b26 Mon Sep 17 00:00:00 2001 From: SaarHV Date: Wed, 21 Dec 2022 20:39:37 +0800 Subject: [PATCH 3/4] Add comment in global declaration file --- shim.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shim.d.ts b/shim.d.ts index 8dd078e..bd8edb8 100644 --- a/shim.d.ts +++ b/shim.d.ts @@ -1,9 +1,12 @@ +// Declaration file, * The vue suffix file is handed over to the vue module for processing declare module '*.vue' { - import { Component } from "vue" - const component: Component - export default component + import type { DefineComponent } from 'vue'; + const component: DefineComponent<{}, {}, any>; + export default component; } +// Declaration file, defining global variables interface Window { nextLoading: boolean; } +declare module 'element-plus/dist/locale/zh-cn.mjs'; -- Gitee From 3bf3a11288fc1ad8f51aa62bc3a914cc8f6b709b Mon Sep 17 00:00:00 2001 From: SaarHV Date: Wed, 21 Dec 2022 20:40:53 +0800 Subject: [PATCH 4/4] Add global plugins file --- plugins.d.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 plugins.d.ts diff --git a/plugins.d.ts b/plugins.d.ts new file mode 100644 index 0000000..102a985 --- /dev/null +++ b/plugins.d.ts @@ -0,0 +1 @@ +declare module 'js-cookie'; \ No newline at end of file -- Gitee