fix FileExplorer style

This commit is contained in:
Timi
2026-04-03 21:17:14 +08:00
parent 59016f492f
commit d819249ebf
3 changed files with 53 additions and 23 deletions

View File

@@ -1,15 +1,5 @@
<template>
<div class="page">
<section v-if="currentSegments.length" class="go-up" @click="openParent">
<div class="icon dir">
<t-icon name="rollback" />
</div>
<div class="meta">
<p class="name">返回上一级</p>
<p class="desc">当前目录的父级目录</p>
</div>
</section>
<section v-if="currentItems.length" class="content">
<file-explorer-list
v-if="displayMode === 'list'"
@@ -22,7 +12,6 @@
@open="openItem"
/>
</section>
<t-empty v-else description="当前目录为空" />
</div>
</template>
@@ -57,7 +46,7 @@ const emit = defineEmits<{
const route = useRoute();
const router = useRouter();
const navBarStore = useNavBarStore();
const navBarRightOwner = "file-explorer-page";
const navBarRightOwner = `file-explorer-page-${Math.random().toString(36).slice(2)}`;
const fileTree: FileEntry[] = [
{
@@ -184,15 +173,21 @@ const navBarRightRenderer = defineComponent({
name: "file-explorer-nav-right",
setup() {
const buttonComponent = resolveComponent("t-button");
const iconComponent = resolveComponent("t-icon");
return () => h(buttonComponent, {
size: "small",
variant: "text",
theme: "primary",
class: "nav-switch",
shape: "square",
"aria-label": displayModeActionText.value,
onClick: toggleDisplayMode
}, {
default: () => displayModeActionText.value
icon: () => h(iconComponent, {
name: displayMode.value === "list" ? "grid-view" : "view-list",
size: "1.5rem"
})
});
}
});
@@ -333,6 +328,8 @@ async function syncPath(nextSegments: string[]): Promise<void> {
.nav-switch {
padding: 0;
width: 2rem;
height: 2rem;
}
.go-up {