优化代码提示

This commit is contained in:
05412 2024-08-20 14:44:56 +08:00
parent 2ba3d67397
commit c8d8d868ac
2 changed files with 12 additions and 2 deletions

View File

@ -7,8 +7,8 @@ interface SiteConfig {
export const useSiteConfigStore = defineStore('siteConfigStore', ()=> {
const siteConfig = ref<SiteConfig>({
protocol: import.meta.env.VITE_PROTOCOL as string,
host: import.meta.env.VITE_HOST as string
protocol: import.meta.env.VITE_PROTOCOL,
host: import.meta.env.VITE_HOST
})
return { siteConfig }
})

10
src/vite-env.d.ts vendored
View File

@ -1 +1,11 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_PROTOCOL: string,
readonly VITE_HOST: string,
readonly VITE_LOCALE: string,
}
interface ImportMeta {
readonly env: ImportMetaEnv
}