From 29f173c24c75ff5fe27fd07913dfde62b89eafbf Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 6 Nov 2021 14:16:11 +0900 Subject: [PATCH] fix: query parameter on tags page (#4668) --- client/components/tags.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/client/components/tags.vue b/client/components/tags.vue index b8ed976e..3d717b38 100644 --- a/client/components/tags.vue +++ b/client/components/tags.vue @@ -250,6 +250,22 @@ export default { [{name: this.$t('tags:localeAny'), code: 'any'}], (siteLangs.length > 0 ? siteLangs : []) ) + if (this.$route.query.lang) { + this.locale = this.$route.query.lang + } + if (this.$route.query.sort) { + this.orderBy = this.$route.query.sort.toLowerCase() + switch (this.orderBy) { + case 'updatedat': + this.orderBy = 'updatedAt' + break + } + this.pagination.sortBy = [this.orderBy] + } + if (this.$route.query.dir) { + this.orderByDirection = this.$route.query.dir === 'asc' ? 0 : 1 + this.pagination.sortDesc = [this.orderByDirection === 1] + } }, methods: { toggleTag (tag) {