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" />
|
<Icon v="tag" />
|
||||||
<T>pronouns.intro</T><T>quotation.colon</T>
|
<T>pronouns.intro</T><T>quotation.colon</T>
|
||||||
</span>
|
</span>
|
||||||
<ComprehensiveSwitch @update:comprehensive="updated => comprehensive = updated" />
|
<ComprehensiveSwitch v-model="comprehensive" />
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@ -89,8 +89,6 @@ export default {
|
|||||||
exampleCategories: ExampleCategory.from(examples, this.$config),
|
exampleCategories: ExampleCategory.from(examples, this.$config),
|
||||||
short,
|
short,
|
||||||
pronounGroups,
|
pronounGroups,
|
||||||
|
|
||||||
comprehensive: false,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
head() {
|
head() {
|
||||||
@ -100,6 +98,24 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
computed: {
|
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() {
|
pronounsChoice() {
|
||||||
if (!this.pronounGroups.length) {
|
if (!this.pronounGroups.length) {
|
||||||
return Object.values(pronouns);
|
return Object.values(pronouns);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user