+
diff --git a/tsconfig.json b/tsconfig.json
index fcd278daeff415b4c2b1681d611e096d176b0760..817a013482d8879e8705401baf15dd79243d3ef1 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -19,6 +19,7 @@
// 非相对模块导入的路径映射配置,根据 baseUrl 配置进行路径计算,与 vite.config 中 alias 配置同步
"paths": {
"@/*": ["src/*"],
+ "~/*": ["*"],
"@@/*": ["src/common/*"]
},
"resolveJsonModule": true,
diff --git a/types/auto/components.d.ts b/types/auto/components.d.ts
index 39f460ccab4ddbdbba191ad49b9ccf64e05503cb..26210f4750b92b55e1b2e17ea390eb46f43f4148 100644
--- a/types/auto/components.d.ts
+++ b/types/auto/components.d.ts
@@ -11,22 +11,14 @@ declare module 'vue' {
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
VanButton: typeof import('vant/es')['Button']
- VanCalendar: typeof import('vant/es')['Calendar']
- VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanConfigProvider: typeof import('vant/es')['ConfigProvider']
VanDivider: typeof import('vant/es')['Divider']
- VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field']
VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon']
- VanImage: typeof import('vant/es')['Image']
VanLoading: typeof import('vant/es')['Loading']
VanNavBar: typeof import('vant/es')['NavBar']
- VanNoticeBar: typeof import('vant/es')['NoticeBar']
- VanRadio: typeof import('vant/es')['Radio']
- VanRadioGroup: typeof import('vant/es')['RadioGroup']
- VanSwitch: typeof import('vant/es')['Switch']
VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem']
}
diff --git a/vite.config.ts b/vite.config.ts
index f3564478b5ecaf9ee0aa15dd63d57d913a0738a8..d210495171372213923be2d45ac02cf572bb3134 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -21,6 +21,8 @@ export default defineConfig(({ mode }) => {
alias: {
// @ 符号指向 src 目录
"@": resolve(__dirname, "src"),
+ // ~ 符号指向根目录
+ "~": resolve(__dirname),
// @@ 符号指向 src/common 通用目录
"@@": resolve(__dirname, "src/common")
}