菜单保持展开

main
MY-SH\lenovo 10 months ago
parent d70d14b77a
commit 3e62a1a954

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 KiB

After

Width:  |  Height:  |  Size: 552 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 KiB

@ -1,6 +1,6 @@
<template> <template>
<div class="navbar"> <div class="navbar">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <!-- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> -->
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/> <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>

@ -1,5 +1,5 @@
<template> <template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> <!-- <div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<transition name="sidebarLogoFade"> <transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" /> <img v-if="logo" :src="logo" class="sidebar-logo" />
@ -10,12 +10,14 @@
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
</router-link> </router-link>
</transition> </transition>
</div> </div> -->
<div class="navTi">{{ navTitle }}</div>
</template> </template>
<script> <script>
import logoImg from '@/assets/logo/logo.png' import logoImg from '@/assets/logo/logo.png'
import variables from '@/assets/styles/variables.scss' import variables from '@/assets/styles/variables.scss'
import { eventBus } from '@/main.js';
export default { export default {
name: 'SidebarLogo', name: 'SidebarLogo',
@ -36,13 +38,28 @@ export default {
data() { data() {
return { return {
title: process.env.VUE_APP_TITLE, title: process.env.VUE_APP_TITLE,
logo: logoImg logo: logoImg,
navTitle:null,
} }
} },
created() {
eventBus.$on('toLogo', (route) => {
this.navTitle = route.meta.title;
console.log(this.navTitle,'kkkkkkkkk');
});
},
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.navTi{
height: 50px;
line-height: 70px;
font-size: 18px;
font-weight: 500;
color: #e4e4e4;
text-align: center;
}
.sidebarLogoFade-enter-active { .sidebarLogoFade-enter-active {
transition: opacity 1.5s; transition: opacity 1.5s;
} }

@ -77,6 +77,7 @@ Vue.use(Element, {
}) })
Vue.config.productionTip = false Vue.config.productionTip = false
export const eventBus = new Vue();
new Vue({ new Vue({
el: '#app', el: '#app',

@ -2,7 +2,7 @@ import Cookies from 'js-cookie'
const state = { const state = {
sidebar: { sidebar: {
opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, opened:true,
withoutAnimation: false, withoutAnimation: false,
hide: false hide: false
}, },
@ -15,7 +15,7 @@ const mutations = {
if (state.sidebar.hide) { if (state.sidebar.hide) {
return false; return false;
} }
state.sidebar.opened = !state.sidebar.opened state.sidebar.opened = true
state.sidebar.withoutAnimation = false state.sidebar.withoutAnimation = false
if (state.sidebar.opened) { if (state.sidebar.opened) {
Cookies.set('sidebarStatus', 1) Cookies.set('sidebarStatus', 1)
@ -25,7 +25,7 @@ const mutations = {
}, },
CLOSE_SIDEBAR: (state, withoutAnimation) => { CLOSE_SIDEBAR: (state, withoutAnimation) => {
Cookies.set('sidebarStatus', 0) Cookies.set('sidebarStatus', 0)
state.sidebar.opened = false state.sidebar.opened = true
state.sidebar.withoutAnimation = withoutAnimation state.sidebar.withoutAnimation = withoutAnimation
}, },
TOGGLE_DEVICE: (state, device) => { TOGGLE_DEVICE: (state, device) => {
@ -36,7 +36,7 @@ const mutations = {
Cookies.set('size', size) Cookies.set('size', size)
}, },
SET_SIDEBAR_HIDE: (state, status) => { SET_SIDEBAR_HIDE: (state, status) => {
state.sidebar.hide = status state.sidebar.hide = false
} }
} }

@ -24,6 +24,7 @@
<script> <script>
import { constantRoutes } from "@/router"; import { constantRoutes } from "@/router";
import { eventBus } from '@/main.js';
// //
const hideList = ["/index", "/user/profile"]; const hideList = ["/index", "/user/profile"];
@ -123,6 +124,7 @@ export default {
handleSelect(key, keyPath) { handleSelect(key, keyPath) {
this.currentIndex = key; this.currentIndex = key;
const route = this.routers.find((item) => item.path === key); const route = this.routers.find((item) => item.path === key);
eventBus.$emit('toLogo', route);
if (this.ishttp(key)) { if (this.ishttp(key)) {
// http(s):// // http(s)://
window.open(key, "_blank"); window.open(key, "_blank");

@ -3,9 +3,9 @@
<div class="head"> <div class="head">
<div class="doll"> <div class="doll">
<div class="leftBox"> <div class="leftBox">
<img src="../assets/images/logo2.png" alt=""> <img class="hui" src="../assets/images/logo2.png" alt="">
<span> <span>
<p class="pChina">唐河县应急管理平台</p> <p class="pChina">唐河县应急管理综合业务平台</p>
<!--<p class="pEnglish">Ministry of Emergency Management of the People's Republic of China</p>--> <!--<p class="pEnglish">Ministry of Emergency Management of the People's Republic of China</p>-->
</span> </span>
<span class="slogan"> <span class="slogan">
@ -285,7 +285,7 @@ export default {
height: 20%; height: 20%;
background: #056891; background: #056891;
.doll{ .doll{
width: 85%; width: 91%;
height: 100%; height: 100%;
margin: auto; margin: auto;
display: flex; display: flex;
@ -309,7 +309,7 @@ export default {
align-items: center; align-items: center;
img{ img{
width: 100px; width: 120px;
height: auto; height: auto;
margin-right: 35px; margin-right: 35px;
} }
@ -338,7 +338,7 @@ export default {
flex-direction: column; flex-direction: column;
.ft{ .ft{
object-fit: contain; object-fit: contain;
width: 222px !important; width: 300px !important;
} }
} }
} }
@ -355,4 +355,8 @@ export default {
font-size: 20px; font-size: 20px;
} }
} }
.hui{
width: 65px !important;
height: 65px !important;
}
</style> </style>

Loading…
Cancel
Save