Skip to content

Commit

Permalink
fix: query parameter on tags page (#4668)
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 authored Nov 6, 2021
1 parent 87fcfca commit 29f173c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions client/components/tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 29f173c

Please sign in to comment.