fix: remain in the same position of list when back

This commit is contained in:
niubility000 2024-03-16 02:55:06 +08:00 committed by GitHub
parent 1c079a2719
commit b27d5b2dcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@
<breadcrumbs base="/files" />
<listing />
<transition name="closing">
<errors v-if="error" :errorCode="error.status" />
<component v-else-if="currentView" :is="currentView"></component>
<div v-else-if="currentView !== null">
@ -16,6 +17,7 @@
<span>{{ $t("files.loading") }}</span>
</h2>
</div>
</transition>
</div>
</template>
@ -79,21 +81,13 @@ export default {
if (from.path.endsWith("/")) {
if (to.path.endsWith("/")) {
window.sessionStorage.setItem("listFrozen", "false");
this.fetchData();
return;
} else {
window.sessionStorage.setItem("listFrozen", "true");
this.fetchData();
return;
}
} else if (to.path.endsWith("/")) {
this.$store.commit("updateRequest", {});
this.fetchData();
return;
} else {
this.fetchData();
return;
}
this.fetchData();
},
reload: function (value) {
if (value === true) {
@ -159,3 +153,13 @@ export default {
},
};
</script>
<style>
.closing-leave-active {
animation: closing 0.5s
}
@keyframes closing {
to {
transform: scale(0);
}
}
</style>