fix: fix sidebar navigation on mobile devices (#1618)

pull/1615/head^2
niubility000 2021-10-20 00:37:12 +08:00 committed by GitHub
parent 6f345be3e4
commit f09bf3e1d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 6 deletions

View File

@ -1,15 +1,15 @@
<template>
<nav :class="{ active }">
<template v-if="isLogged">
<router-link
<button
class="action"
to="/files/"
@click="toRoot"
:aria-label="$t('sidebar.myFiles')"
:title="$t('sidebar.myFiles')"
>
<i class="material-icons">folder</i>
<span>{{ $t("sidebar.myFiles") }}</span>
</router-link>
</button>
<div v-if="user.perm.create">
<button
@ -34,15 +34,15 @@
</div>
<div>
<router-link
<button
class="action"
to="/settings"
@click="toSettings"
:aria-label="$t('sidebar.settings')"
:title="$t('sidebar.settings')"
>
<i class="material-icons">settings_applications</i>
<span>{{ $t("sidebar.settings") }}</span>
</router-link>
</button>
<button
v-if="authMethod == 'json'"
@ -125,6 +125,14 @@ export default {
authMethod: () => authMethod,
},
methods: {
toRoot() {
this.$router.push({ path: "/files/" }, () => {});
this.$store.commit("closeHovers");
},
toSettings() {
this.$router.push({ path: "/settings" }, () => {});
this.$store.commit("closeHovers");
},
help() {
this.$store.commit("showHover", "help");
},