浏览代码

feat: 修改ts声名

bill 1 年之前
父节点
当前提交
df8ff758d7
共有 3 个文件被更改,包括 2 次插入7 次删除
  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>
 <script lang="ts" setup>
 import { ElLoading } from "element-plus";
 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";
 import { lifeHook } from "./request/state";
 
 
 let loading: ReturnType<typeof ElLoading.service> | null = null;
 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;
   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();
     const now = Date.now();
     if (now - previous >= delay) {
     if (now - previous >= delay) {
       fn.apply(this, args);
       fn.apply(this, args);

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

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