diff --git a/package.json b/package.json index 720169c4ef7cca3b90e5b9802b21bb2966215ad0..fa77db4f3f1feaeb534f3f6e7fb5d67a117fe74f 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/plugins.d.ts b/plugins.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..102a985457ef5cf302089b534afbc61761ca77e2 --- /dev/null +++ b/plugins.d.ts @@ -0,0 +1 @@ +declare module 'js-cookie'; \ No newline at end of file diff --git a/shim.d.ts b/shim.d.ts index 8dd078e0f75602dce14dd619e52a4c6e78eefe8a..bd8edb8e18c0c39ef4e972300514d79046c168e0 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'; diff --git a/src/main.ts b/src/main.ts index f8a0111200886eb652c7cd40d3810ac6ad100772..47c29678c642a00e2e5f505caea72fce1c5e1cdc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,10 +4,14 @@ 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'; + import { locale } from 'element-plus' const app = createApp(App); app.use(pinia).use(router).use(ElementPlus, { locale }).mount('#app') + +app.config.globalProperties.mittBus = mitt();