update FileExplorer

This commit is contained in:
Timi
2026-04-03 14:58:30 +08:00
parent ded231671a
commit 603a503644
9 changed files with 335 additions and 178 deletions

View File

@@ -0,0 +1,51 @@
<template>
<t-cell-group theme="card" class="list-view">
<recycle-scroller
class="scroller"
:items="items"
:item-size="56"
key-field="path"
v-slot="{ item }"
>
<t-swipe-cell class="swipe">
<t-cell
:title="item.name"
:arrow="item.type === 'dir'"
:note="item.size"
@click="emit('open', item)"
>
<template #left-icon>
<t-icon :name="item.type === 'dir' ? 'folder' : item.icon" />
</template>
</t-cell>
</t-swipe-cell>
</recycle-scroller>
</t-cell-group>
</template>
<script setup lang="ts">
import { RecycleScroller } from "vue-virtual-scroller";
import { type ExplorerItem } from "./fileExplorer.shared";
defineProps<{
items: ExplorerItem[];
}>();
const emit = defineEmits<{
open: [item: ExplorerItem];
}>();
</script>
<style scoped lang="less">
.list-view {
overflow: hidden;
:deep(.t-cell-group) {
margin: 0;
}
}
.scroller {
height: 100%;
}
</style>