Browse Source

feat: 修改ts声名

bill 1 year ago
parent
commit
df8ff758d7
3 changed files with 2 additions and 7 deletions
  1. 1 1
      src/App.vue
  2. 1 4
      src/util/index.ts
  3. 0 2
      src/vite-env.d.ts

+ 1 - 1
src/App.vue

@@ -10,7 +10,7 @@
 
 <script lang="ts" setup>
 import { ElLoading } from "element-plus";
-import zhCn from "element-plus/locale/zh-cn.mjs";
+import zhCn from "element-plus/es/locale/lang/zh-cn";
 import { lifeHook } from "./request/state";
 
 let loading: ReturnType<typeof ElLoading.service> | null = null;

+ 1 - 4
src/util/index.ts

@@ -15,10 +15,7 @@ export const throttle = <T extends (...args: any) => any>(
 ) => {
   let previous = 0;
 
-  return function <Args extends Array<any>, This>(
-    this: This,
-    ...args: Parameters<T>
-  ) {
+  return function <This>(this: This, ...args: Parameters<T>) {
     const now = Date.now();
     if (now - previous >= delay) {
       fn.apply(this, args);

+ 0 - 2
src/vite-env.d.ts

@@ -1,5 +1,3 @@
 /// <reference types="vite/client" />
 
 import "element-plus/global.d.ts";
-
-declare module "element-plus/dist/locale/zh-cn.mjs";