ソースを参照

chore: updrade typescript to v4.8

suzigang 3 年 前
コミット
c62fd98a1a

+ 1 - 1
package.json

@@ -115,7 +115,7 @@
     "swiper": "6.5.1",
     "transliteration": "^2.2.0",
     "ts-jest": "^26.5.5",
-    "typescript": "4.6.4",
+    "typescript": "^4.6.4",
     "vite": "2.9.0",
     "vite-plugin-dts": "^1.0.5",
     "vite-plugin-md": "^0.11.8",

+ 2 - 2
src/packages/utils/useExpose/index.ts

@@ -1,8 +1,8 @@
-import { getCurrentInstance } from 'vue';
+import { getCurrentInstance, ComponentPublicInstance } from 'vue';
 
 export function useExpose(apis: Record<string, any>) {
   const instance = getCurrentInstance();
   if (instance) {
-    Object.assign(instance.proxy, apis);
+    Object.assign(instance.proxy as ComponentPublicInstance, apis);
   }
 }

+ 2 - 2
src/packages/utils/useRelation/useRelation.ts

@@ -1,7 +1,7 @@
-import { getCurrentInstance } from 'vue';
+import { getCurrentInstance, ComponentPublicInstance } from 'vue';
 export function useExtend<T>(apis: T) {
   const instance = getCurrentInstance();
   if (instance) {
-    Object.assign(instance.proxy, apis);
+    Object.assign(instance.proxy as ComponentPublicInstance, apis);
   }
 }