菜单保持展开

main
MY-SH\lenovo 9 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>
<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"/>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>

@ -1,5 +1,5 @@
<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">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<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>
</router-link>
</transition>
</div>
</div> -->
<div class="navTi">{{ navTitle }}</div>
</template>
<script>
import logoImg from '@/assets/logo/logo.png'
import variables from '@/assets/styles/variables.scss'
import { eventBus } from '@/main.js';
export default {
name: 'SidebarLogo',
@ -36,13 +38,28 @@ export default {
data() {
return {
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>
<style lang="scss" scoped>
.navTi{
height: 50px;
line-height: 70px;
font-size: 18px;
font-weight: 500;
color: #e4e4e4;
text-align: center;
}
.sidebarLogoFade-enter-active {
transition: opacity 1.5s;
}

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

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

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

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

Loading…
Cancel
Save