Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
feat: some optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Aug 15, 2023
1 parent 54cd2ab commit 66fd04b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/client/src/components/tree/TaskTreeRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ export function renderLabel({ option }: { option: TreeOption }) {
}
}
} else {
return <span>{option.key === '/' ? '[ROOT]' : option.label}</span>
return (
<span class={actived ? 'underline' : ''}>
{option.key === '/' ? '[ROOT]' : option.label}
</span>
)
}
}

Expand Down
8 changes: 7 additions & 1 deletion packages/client/src/data/filesystem.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TreeOption, TreeSelectOption } from 'naive-ui'
import { computed, ref } from 'vue'
import { computed, ref, watch } from 'vue'

import {
type Path,
Expand All @@ -15,6 +15,12 @@ export const expandKey = ref<PathKey[]>(['/' as PathKey])
export const renameKey = ref<string | null>(null)
export const renameInto = ref<string | null>(null)

watch(expandKey, nv => {
if (!nv.includes('/' as PathKey)) {
expandKey.value = ['/' as PathKey, ...nv]
}
})

export function makePngUrl(v: string | null) {
const fallback = '/favicon-32x32.png'
if (v && v.endsWith('.png')) {
Expand Down

0 comments on commit 66fd04b

Please sign in to comment.