app.$http = axios; Can LOGIN now

This commit is contained in:
Cindy Chang
2024-07-09 14:53:21 +08:00
parent 8b99a230d7
commit a2703bef6e
2 changed files with 42 additions and 30 deletions

14
src/types/vue.d.ts vendored Normal file
View File

@@ -0,0 +1,14 @@
import { AxiosInstance } from 'axios';
import { App } from 'vue';
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$http: AxiosInstance;
}
}
// 將類型擴展到 Vue 應用實例
declare module 'vue' {
interface App {
$http: AxiosInstance;
}