chore: code format

This commit is contained in:
xiaojunnuo
2025-06-29 14:09:09 +08:00
parent 04422a4637
commit 4fcfd089d8
644 changed files with 10845 additions and 13184 deletions
@@ -11,7 +11,7 @@ import { TabsToolMore, TabsToolScreen, TabsView } from "../../../tabs-ui";
import { useTabbar } from "./use-tabbar";
defineOptions({
name: "LayoutTabbar"
name: "LayoutTabbar",
});
defineProps<{ showIcon?: boolean; theme?: string }>();
@@ -26,11 +26,11 @@ const { createContextMenus, currentActive, currentTabs, handleClick, handleClose
const menus = computed(() => {
const tab = tabbarStore.getTabByPath(currentActive.value);
const menus = createContextMenus(tab);
return menus.map((item) => {
return menus.map(item => {
return {
...item,
label: item.text,
value: item.key
value: item.key,
};
});
});
@@ -56,8 +56,8 @@ export function useTabbar() {
...tab,
meta: {
...tab?.meta,
title: $t(tab?.meta?.title as string)
}
title: $t(tab?.meta?.title as string),
},
};
}
@@ -75,7 +75,7 @@ export function useTabbar() {
const meta = route.matched?.[route.matched.length - 1]?.meta;
tabbarStore.addTab({
...route,
meta: meta || route.meta
meta: meta || route.meta,
});
},
{ immediate: true }
@@ -94,7 +94,7 @@ export function useTabbar() {
},
icon: X,
key: "close",
text: $t("preferences.tabbar.contextMenu.close")
text: $t("preferences.tabbar.contextMenu.close"),
},
{
handler: async () => {
@@ -102,7 +102,7 @@ export function useTabbar() {
},
icon: affixTab ? PinOff : Pin,
key: "affix",
text: affixTab ? $t("preferences.tabbar.contextMenu.unpin") : $t("preferences.tabbar.contextMenu.pin")
text: affixTab ? $t("preferences.tabbar.contextMenu.unpin") : $t("preferences.tabbar.contextMenu.pin"),
},
{
handler: async () => {
@@ -113,14 +113,14 @@ export function useTabbar() {
},
icon: contentIsMaximize.value ? Minimize2 : Fullscreen,
key: contentIsMaximize.value ? "restore-maximize" : "maximize",
text: contentIsMaximize.value ? $t("preferences.tabbar.contextMenu.restoreMaximize") : $t("preferences.tabbar.contextMenu.maximize")
text: contentIsMaximize.value ? $t("preferences.tabbar.contextMenu.restoreMaximize") : $t("preferences.tabbar.contextMenu.maximize"),
},
{
disabled: disabledRefresh,
handler: refreshTab,
icon: RotateCw,
key: "reload",
text: $t("preferences.tabbar.contextMenu.reload")
text: $t("preferences.tabbar.contextMenu.reload"),
},
{
handler: async () => {
@@ -129,7 +129,7 @@ export function useTabbar() {
icon: ExternalLink,
key: "open-in-new-window",
separator: true,
text: $t("preferences.tabbar.contextMenu.openInNewWindow")
text: $t("preferences.tabbar.contextMenu.openInNewWindow"),
},
{
@@ -139,7 +139,7 @@ export function useTabbar() {
},
icon: ArrowLeftToLine,
key: "close-left",
text: $t("preferences.tabbar.contextMenu.closeLeft")
text: $t("preferences.tabbar.contextMenu.closeLeft"),
},
{
disabled: disabledCloseRight,
@@ -149,7 +149,7 @@ export function useTabbar() {
icon: ArrowRightToLine,
key: "close-right",
separator: true,
text: $t("preferences.tabbar.contextMenu.closeRight")
text: $t("preferences.tabbar.contextMenu.closeRight"),
},
{
disabled: disabledCloseOther,
@@ -158,15 +158,15 @@ export function useTabbar() {
},
icon: FoldHorizontal,
key: "close-other",
text: $t("preferences.tabbar.contextMenu.closeOther")
text: $t("preferences.tabbar.contextMenu.closeOther"),
},
{
disabled: disabledCloseAll,
handler: closeAllTabs,
icon: ArrowRightLeft,
key: "close-all",
text: $t("preferences.tabbar.contextMenu.closeAll")
}
text: $t("preferences.tabbar.contextMenu.closeAll"),
},
];
return menus;
};
@@ -176,6 +176,6 @@ export function useTabbar() {
currentActive,
currentTabs,
handleClick,
handleClose
handleClose,
};
}