From 715fc9824e7662fd8681f3982e6bd7504f42f09b Mon Sep 17 00:00:00 2001 From: Daria Golova Date: Wed, 16 Aug 2023 23:53:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=81=D0=B0=D0=B9=D0=B4=D0=B1=D0=B0=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TheSidebar.vue | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/components/TheSidebar.vue b/src/components/TheSidebar.vue index 6ef976a..3ca515b 100644 --- a/src/components/TheSidebar.vue +++ b/src/components/TheSidebar.vue @@ -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); + }); + }, };