Skip to content

Commit 17f31a0

Browse files
committed
#62 double click navigation demo
1 parent 4e5770d commit 17f31a0

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/components/FileBrowser.vue

+6-3
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@ tbody {
196196

197197
<tr v-if="path.length > 0">
198198
<td class="px-3">
199-
<router-link to="../">
199+
<div @dblclick="exit">
200200
<a
201201
href="javascript:null"
202-
v-on:click="back"
202+
@dblclick="back"
203203
>..</a
204204
>
205-
</router-link>
205+
</div>
206206
</td>
207207
</tr>
208208

@@ -450,6 +450,9 @@ export default {
450450
this.$store.dispatch("files/updateCreateFolderInputShow", false);
451451
await this.$store.dispatch("files/openDropdown", null);
452452
},
453+
exit() {
454+
this.$router.push("../");
455+
},
453456
454457
async goToRoutePath() {
455458
if (typeof this.routePath === "string") {

src/components/FileEntry.vue

+10-2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ a {
6868
scope="row"
6969
v-bind:class="{ 'selected-row': isFileSelected() }"
7070
v-on:click="selectFile"
71+
@dblclick="dbClickItem"
7172
>
7273
<td class="w-50" data-ls-disabled>
7374
<span v-if="file.type === 'folder'">
@@ -89,11 +90,11 @@ a {
8990
</svg>
9091

9192
<span v-on:click="fileClick">
92-
<router-link v-bind:to="link">
93+
<a>
9394
<a href="javascript:null" style="margin-left: 5px">
9495
{{ filename }}
9596
</a>
96-
</router-link>
97+
</a>
9798
</span>
9899
</span>
99100

@@ -445,6 +446,13 @@ export default {
445446
},
446447
447448
methods: {
449+
dbClickItem() {
450+
if (this.file.type === "folder") {
451+
this.$router.push(this.link);
452+
} else if (this.file.type === "file") {
453+
this.openModal();
454+
}
455+
},
448456
openModal() {
449457
this.$store.commit("files/openModal", this.path + this.file.Key);
450458
},

0 commit comments

Comments
 (0)