Skip to content

Commit 8ca42cb

Browse files
author
sifan
committed
🐛 修复在vue2 + ts中使用报属性不存的bug
1 parent 7985e40 commit 8ca42cb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

index.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ declare module "@vue/runtime-core" {
1212
}
1313
}
1414

15+
declare module 'vue/types/vue' {
16+
interface Vue {
17+
$http: AxiosStatic;
18+
axios: AxiosStatic;
19+
}
20+
21+
interface VueConstructor {
22+
axios: AxiosStatic;
23+
}
24+
}
25+
1526
declare function VueAxios(app: App, axios: AxiosStatic): void;
1627

1728
export default VueAxios;

0 commit comments

Comments
 (0)