From 3a1a12017eb52bc6cd1744e60f5f7fa940015ee2 Mon Sep 17 00:00:00 2001 From: purocean Date: Fri, 2 Aug 2019 18:54:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E6=A0=91?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E9=80=89=E4=B8=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/TreeNode.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/TreeNode.vue b/frontend/src/components/TreeNode.vue index 500a26aa..5af041cb 100644 --- a/frontend/src/components/TreeNode.vue +++ b/frontend/src/components/TreeNode.vue @@ -19,7 +19,7 @@ @dblclick.ctrl.exact="revealInExplorer()" @contextmenu.ctrl.prevent="renameFile" @contextmenu.shift.prevent="deleteFile" - :style="{background: selected ? '#313131' : 'none'}"> {{ item.name }} + :style="{background: selected ? '#5d5d5d' : 'none'}"> {{ item.name }} @@ -154,10 +154,18 @@ export default { computed: { ...mapState('app', ['currentFile', 'currentRepo']), selected () { - return this.currentFile && this.currentFile.path === this.item.path && this.currentFile.repo === this.item.repo + if (!this.currentFile) { + return false + } + + if (this.item.type === 'dir') { + return this.currentFile.repo === this.item.repo && this.currentFile.path.startsWith(this.item.path + '/') + } + + return this.currentFile.repo === this.item.repo && this.currentFile.path === this.item.path }, shouldOpen () { - return this.currentFile && this.item.type === 'dir' && this.currentFile.path.startsWith(this.item.path + '/') + return this.item.type === 'dir' && this.currentFile && this.currentFile.path.startsWith(this.item.path + '/') && this.currentFile.repo === this.item.repo } }, watch: { @@ -179,7 +187,7 @@ export default { .tree-node { border-left: 1px rgb(87, 87, 87) solid; font-size: 16px; - line-height: 1.3em; + line-height: 1.4em; padding-left: 1em; } @@ -191,6 +199,7 @@ export default { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; + padding-left: 0.2em; } .dir-label .count {