mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(de)(pronouns) fix comprehensive switch on any rout
This commit is contained in:
parent
f87123faf7
commit
cedbbc9bee
@ -7,7 +7,7 @@
|
||||
<Icon v="tag" />
|
||||
<T>pronouns.intro</T><T>quotation.colon</T>
|
||||
</span>
|
||||
<ComprehensiveSwitch @update:comprehensive="updated => comprehensive = updated" />
|
||||
<ComprehensiveSwitch v-model="comprehensive" />
|
||||
</h2>
|
||||
|
||||
<section>
|
||||
@ -89,8 +89,6 @@ export default {
|
||||
exampleCategories: ExampleCategory.from(examples, this.$config),
|
||||
short,
|
||||
pronounGroups,
|
||||
|
||||
comprehensive: false,
|
||||
};
|
||||
},
|
||||
head() {
|
||||
@ -100,6 +98,24 @@ export default {
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
comprehensive: {
|
||||
get() {
|
||||
return Object.hasOwn(this.$route.query, this.$config.pronouns.comprehensive);
|
||||
},
|
||||
set(value) {
|
||||
if (value === this.comprehensive) {
|
||||
// prevent warning that $router.replace has no effect
|
||||
return;
|
||||
}
|
||||
const query = structuredClone(this.$route.query);
|
||||
if (value) {
|
||||
query[this.$config.pronouns.comprehensive] = null;
|
||||
} else {
|
||||
delete query[this.$config.pronouns.comprehensive];
|
||||
}
|
||||
this.$router.replace({ query });
|
||||
},
|
||||
},
|
||||
pronounsChoice() {
|
||||
if (!this.pronounGroups.length) {
|
||||
return Object.values(pronouns);
|
||||
|
Loading…
x
Reference in New Issue
Block a user