diff --git a/components/tabbar.uvue b/components/tabbar.uvue index 7c9ce7d..8ed86cd 100644 --- a/components/tabbar.uvue +++ b/components/tabbar.uvue @@ -66,7 +66,9 @@ const list = computed(() => { // 隐藏原生 tabBar // #ifndef MP -uni.hideTabBar(); +if (ctx.tabBar.list != null) { + uni.hideTabBar(); +} // #endif diff --git a/cool/ctx/index.ts b/cool/ctx/index.ts index 7f9a101..08ebe14 100644 --- a/cool/ctx/index.ts +++ b/cool/ctx/index.ts @@ -1,4 +1,4 @@ -import { isArray, isEmpty, isNull } from "../utils"; +import { isArray, parse } from "../utils"; type Page = { path: string; @@ -49,7 +49,9 @@ export type Ctx = { }; // 初始化 ctx 对象,不可修改!! -export const ctx = {} as Ctx; +export const ctx = parse({})!; + +console.log(ctx); // PAGES 用于存储所有页面的路径及样式信息 export let PAGES: Page[] = [...ctx.pages]; @@ -77,8 +79,8 @@ PAGES.forEach((e) => { export let TABS: TabBarItem[] = []; // 如果 tabBar 配置存在且列表不为空,则初始化 TABS -if (!isNull(ctx.tabBar) && !isEmpty(ctx.tabBar.list!)) { - TABS = ctx.tabBar.list!; +if (ctx.tabBar.list != null) { + TABS = ctx.tabBar.list; // 确保每个 tabBar 页面的路径都以 "/" 开头 TABS.forEach((e) => { diff --git a/package.json b/package.json index 4595f10..7a3cd86 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@babel/parser": "^7.27.5", "@babel/types": "^7.27.6", "@cool-vue/ai": "^1.1.7", - "@cool-vue/vite-plugin": "^8.2.10", + "@cool-vue/vite-plugin": "^8.2.11", "@dcloudio/types": "^3.4.16", "@types/node": "^24.0.15", "@vue/compiler-sfc": "^3.5.16", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4bc6f08..c6ffb33 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,8 +28,8 @@ importers: specifier: ^1.1.7 version: 1.1.7 '@cool-vue/vite-plugin': - specifier: ^8.2.10 - version: 8.2.10 + specifier: ^8.2.11 + version: 8.2.11 '@dcloudio/types': specifier: ^3.4.16 version: 3.4.16 @@ -88,8 +88,8 @@ packages: resolution: {integrity: sha512-zXjuydK6Rzfywr69bR9qnWueS09rqfuv4bbVKSntnHnApqpb6Dow7yOcR+CwzaCkSYJCnbM2DG2Wc0ZDQQe1oQ==} hasBin: true - '@cool-vue/vite-plugin@8.2.10': - resolution: {integrity: sha512-CukFbHN5hc6l8Sv7mZrzsahUdnzc7ONHJGbD5Nv0G10YNFV6JNUpfFNjY5ilLdv8IIaTV3DD0vueqDHrMFHSRg==} + '@cool-vue/vite-plugin@8.2.11': + resolution: {integrity: sha512-xh0+YQAHi5JiRg7UGv1r3uoKnFmJzfU43+T6tM/74OPkG8CLCENLr0+2H+p/iJWB/sj19gKEknXgLb3WWM4k6Q==} '@dcloudio/types@3.4.16': resolution: {integrity: sha512-gJIr1OWtePTDDdjtp8Kh72S/ZGLunoSfHiUvRtXhBmAFNkDWuAKFO90hv62k3GYN/st04xUBQNtBfvhu/YHjww==} @@ -1376,7 +1376,7 @@ snapshots: transitivePeerDependencies: - debug - '@cool-vue/vite-plugin@8.2.10': + '@cool-vue/vite-plugin@8.2.11': dependencies: '@vue/compiler-sfc': 3.5.17 axios: 1.10.0 diff --git a/vite.config.ts b/vite.config.ts index b7e8d46..119edc3 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -32,12 +32,5 @@ export default defineConfig({ postcss: { plugins: [tailwindcss({ config: resolve("./tailwind.config.ts") })] } - }, - - resolve: { - alias: { - "@": resolve("./"), - $: resolve("./uni_modules/") - } } });