diff --git a/src/layouts/SideMenu.vue b/src/layouts/SideMenu.vue index 10884e6..59fe315 100644 --- a/src/layouts/SideMenu.vue +++ b/src/layouts/SideMenu.vue @@ -10,11 +10,7 @@ tag="a" class="intro-x flex items-center pl-5 pt-4" > - + @@ -37,7 +33,7 @@ class="side-menu" :class="{ 'side-menu--active': menu.active, - 'side-menu--open': menu.activeDropdown + 'side-menu--open': menu.activeDropdown, }" @click.native="linkTo(menu)" > @@ -77,7 +73,7 @@ v-if="$h.isset(subMenu.subMenu)" class="side-menu__sub-icon" :class="{ - 'transform rotate-180': subMenu.activeDropdown + 'transform rotate-180': subMenu.activeDropdown, }" /> @@ -90,8 +86,9 @@ " >
  • - +
    @@ -144,27 +141,25 @@ export default { components: { SideMenuTooltip, MobileMenu, - TopBar + TopBar, }, data() { return { - formattedMenu: [] + formattedMenu: [], }; }, computed: { sideMenu() { return this.nestedMenu(this.$store.state.sideMenu.menu); - } + }, }, watch: { $route() { this.formattedMenu = this.$h.assign(this.sideMenu); - } + }, }, mounted() { - cash("body") - .removeClass("login") - .addClass("app"); + cash("body").removeClass("login").addClass("app"); this.formattedMenu = this.$h.assign(this.sideMenu); }, methods: { @@ -182,7 +177,7 @@ export default { menu[key].activeDropdown = this.findActiveMenu(item.subMenu); menu[key] = { ...item, - ...this.nestedMenu(item.subMenu) + ...this.nestedMenu(item.subMenu), }; } }); @@ -191,7 +186,7 @@ export default { }, findActiveMenu(subMenu) { let match = false; - subMenu.forEach(item => { + subMenu.forEach((item) => { if (item.pageName == this.$route.name && !item.ignore) { match = true; } else if (!match && this.$h.isset(item.subMenu)) { @@ -204,9 +199,11 @@ export default { if (this.$h.isset(menu.subMenu)) { menu.activeDropdown = !menu.activeDropdown; } else { - this.$router.push({ - name: menu.pageName - }); + if (this.$route.name != menu.pageName) { + this.$router.push({ + name: menu.pageName, + }); + } } }, enter(el, done) { @@ -214,10 +211,10 @@ export default { el, "slideDown", { - duration: 300 + duration: 300, }, { - complete: done + complete: done, } ); }, @@ -226,13 +223,13 @@ export default { el, "slideUp", { - duration: 300 + duration: 300, }, { - complete: done + complete: done, } ); - } - } + }, + }, }; diff --git a/src/router/index.js b/src/router/index.js index 8b98b49..60f0f18 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -356,6 +356,12 @@ const routes = [ name: 'my-app', meta: { title: ['我的应用', '创建应用'] }, component: () => import('@/views/CreateAn') + }, + { + path: 'chat/CreateAn', + name: 'side-menu-chat', + meta: { title: ['消息中心', '详情'] }, + component: () => import('@/views/ChatDetails') } ] }, diff --git a/src/views/Chat.vue b/src/views/Chat.vue index 54e7c1c..664195e 100644 --- a/src/views/Chat.vue +++ b/src/views/Chat.vue @@ -1,6 +1,6 @@