update FileExplorer
This commit is contained in:
51
src/pages/file/FileExplorerList.vue
Normal file
51
src/pages/file/FileExplorerList.vue
Normal 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>
|
||||
Reference in New Issue
Block a user