refactor: tree-ex ellipsis + listview style
This commit is contained in:
parent
e18450cdbd
commit
d82cf45417
2 changed files with 19 additions and 2 deletions
|
|
@ -166,7 +166,7 @@ const onRowClick = (evt: Event, row: TreeDataFolder, index: number) => {
|
||||||
class="cursor"
|
class="cursor"
|
||||||
>
|
>
|
||||||
<template v-slot:body-cell-name="nameRow">
|
<template v-slot:body-cell-name="nameRow">
|
||||||
<q-td>
|
<q-td style="width: 50%">
|
||||||
<q-icon :name="currentIcon" size="2em" color="primary" />
|
<q-icon :name="currentIcon" size="2em" color="primary" />
|
||||||
{{ nameRow.row.name }}
|
{{ nameRow.row.name }}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
@ -257,9 +257,11 @@ const onRowClick = (evt: Event, row: TreeDataFolder, index: number) => {
|
||||||
row-key="name"
|
row-key="name"
|
||||||
hide-bottom
|
hide-bottom
|
||||||
:rows-per-page-options="[0]"
|
:rows-per-page-options="[0]"
|
||||||
|
class="cursor"
|
||||||
>
|
>
|
||||||
<template v-slot:body-cell-name="nameRow">
|
<template v-slot:body-cell-name="nameRow">
|
||||||
<q-td
|
<q-td
|
||||||
|
style="width: 50%"
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
getFolder(nameRow.row.pathname)
|
getFolder(nameRow.row.pathname)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ import { storeToRefs } from 'pinia'
|
||||||
import { useTreeDataStore, type TreeDataFolder } from '@/stores/tree-data'
|
import { useTreeDataStore, type TreeDataFolder } from '@/stores/tree-data'
|
||||||
import { useSearchDataStore } from '@/stores/searched-data'
|
import { useSearchDataStore } from '@/stores/searched-data'
|
||||||
import { useFileInfoStore } from '@/stores/file-info-data'
|
import { useFileInfoStore } from '@/stores/file-info-data'
|
||||||
|
import { computed } from '@vue/reactivity'
|
||||||
|
import FolderForm from './FolderForm.vue'
|
||||||
|
|
||||||
const { isSearch } = storeToRefs(useSearchDataStore())
|
const { isSearch } = storeToRefs(useSearchDataStore())
|
||||||
const { isPreview } = storeToRefs(useFileInfoStore())
|
const { isPreview } = storeToRefs(useFileInfoStore())
|
||||||
|
|
@ -17,6 +19,8 @@ const props = withDefaults(
|
||||||
level: 0,
|
level: 0,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const MAX_NAME_LENGTH = 20
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -40,7 +44,12 @@ const props = withDefaults(
|
||||||
? 'inbox'
|
? 'inbox'
|
||||||
: 'o_folder_open'
|
: 'o_folder_open'
|
||||||
"
|
"
|
||||||
:label="folder.name"
|
:label="
|
||||||
|
folder.name.length > MAX_NAME_LENGTH
|
||||||
|
? folder.name.slice(0, MAX_NAME_LENGTH) + '...'
|
||||||
|
: folder.name
|
||||||
|
"
|
||||||
|
class="text-overflow-handle"
|
||||||
v-model="folder.status"
|
v-model="folder.status"
|
||||||
>
|
>
|
||||||
<tree-explorer
|
<tree-explorer
|
||||||
|
|
@ -61,4 +70,10 @@ const props = withDefaults(
|
||||||
.q-item[aria-expanded='true'] .q-icon {
|
.q-item[aria-expanded='true'] .q-icon {
|
||||||
color: $primary;
|
color: $primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-overflow-handle {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue