icssoa пре 8 месеци
родитељ
комит
76002da89f
2 измењених фајлова са 5 додато и 6 уклоњено
  1. 4 6
      components/tabbar.uvue
  2. 1 0
      cool/ctx/index.ts

+ 4 - 6
components/tabbar.uvue

@@ -14,7 +14,7 @@
 				@tap="router.to(item.pagePath)"
 			>
 				<cl-image
-					:src="router.path() == item.pagePath ? item.icon2 : item.icon"
+					:src="path == item.pagePath ? item.icon2 : item.icon"
 					:height="56"
 					:width="56"
 				></cl-image>
@@ -24,11 +24,7 @@
 					:pt="{
 						className: parseClass([
 							'!text-xs mt-1',
-							[
-								router.path() == item.pagePath,
-								'!text-primary-500',
-								'!text-surface-400'
-							]
+							[path == item.pagePath, '!text-primary-500', '!text-surface-400']
 						])
 					}"
 					>{{ t(item.text!) }}</cl-text
@@ -50,6 +46,8 @@ type Item = {
 	text: string | null;
 };
 
+const path = computed(() => router.path());
+
 // tabbar 列表
 const list = computed<Item[]>(() => {
 	return (ctx.tabBar.list ?? []).map((e) => {

+ 1 - 0
cool/ctx/index.ts

@@ -19,6 +19,7 @@ export type TabBarItem = {
 };
 
 export type TabBar = {
+	custom?: boolean;
 	color?: string;
 	selectedColor?: string;
 	backgroundColor?: string;