From c6dd932a0b755a63e72d00942ea1ba1fa6669506 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Nov 2020 12:30:16 +0900 Subject: Improve usability --- src/client/components/ui/a.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/client/components') diff --git a/src/client/components/ui/a.vue b/src/client/components/ui/a.vue index 384ee0259e..f6c66257b3 100644 --- a/src/client/components/ui/a.vue +++ b/src/client/components/ui/a.vue @@ -121,7 +121,11 @@ export default defineComponent({ return this.window(); } - this.$router.push(this.to); + if (this.$router.currentRoute.value.path === this.to) { + window.scroll({ top: 0, behavior: 'smooth' }); + } else { + this.$router.push(this.to); + } } } } -- cgit v1.2.3-freya