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