Поправила кнопки на сайдбаре
This commit is contained in:
@@ -70,17 +70,9 @@ export default {
|
|||||||
return this.pageSettings.find((el) => el.id === "settings");
|
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: {
|
watch: {
|
||||||
"$route.path"() {
|
"$route.path"(value) {
|
||||||
if (this.$router.currentRoute._value.fullPath === "/calendar") {
|
if (value === "/calendar") {
|
||||||
this.currentPageBorder = true;
|
this.currentPageBorder = true;
|
||||||
this.pageSettings.forEach((el) =>
|
this.pageSettings.forEach((el) =>
|
||||||
el.path === "#/calendar" ? (el.active = true) : (el.active = false)
|
el.path === "#/calendar" ? (el.active = true) : (el.active = false)
|
||||||
@@ -88,6 +80,13 @@ export default {
|
|||||||
} else this.currentPageBorder = false;
|
} 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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user