Поправила кнопки на сайдбаре

This commit is contained in:
Daria Golova
2023-08-16 23:53:12 +03:00
parent 8691790a53
commit 715fc9824e

View File

@@ -70,17 +70,9 @@ export default {
return this.pageSettings.find((el) => el.id === "settings");
},
},
mounted() {
let href = window.location.href.slice(22);
this.pageSettings.forEach((el, index) => {
el.path === href.substr(href.lastIndexOf("#"))
? (this.pageSettings[index].active = true)
: (this.pageSettings[index].active = false);
});
},
watch: {
"$route.path"() {
if (this.$router.currentRoute._value.fullPath === "/calendar") {
"$route.path"(value) {
if (value === "/calendar") {
this.currentPageBorder = true;
this.pageSettings.forEach((el) =>
el.path === "#/calendar" ? (el.active = true) : (el.active = false)
@@ -88,6 +80,13 @@ export default {
} else this.currentPageBorder = false;
},
},
mounted() {
this.pageSettings.forEach((el, index) => {
el.path === "#" + this.$route.path
? (this.pageSettings[index].active = true)
: (this.pageSettings[index].active = false);
});
},
};
</script>