index.vue
1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<style lang="scss">
.theme-navtl {
position: relative;
height: 100%;
width: 100%;
.qg-page-left {
z-index: auto;
background-color: #fff;
}
}
</style>
<template>
<div class="theme-navtl">
<theme-header/>
<div class="main-container" :class="{'hide-sidebar':!(subMenus && subMenus.length >0)}">
<aside v-show="subMenus && subMenus.length >0" class="qg-page-left">
<sidebar :menus="subMenus" class="sidebar-container"/>
</aside>
<breadcrumb v-show="crumbList.length > 0" id="breadcrumb-container" class="breadcrumb-container"/>
<app-main/>
</div>
</div>
</template>
<script>
import {AppMain, Sidebar, Breadcrumb} from '../../components';
import ResizeMixin from '../../mixin/ResizeHandler';
import {mapState} from 'vuex';
import ThemeHeader from './components/header';
export default {
name: 'ThemeNavtl',
components: {
AppMain,
ThemeHeader,
Sidebar,
Breadcrumb
},
mixins: [ResizeMixin],
computed: {
...mapState({
sidebar: state => state.app.sidebar,
layout: state => state.app.layout,
subMenus: state => state.permission.subMenus,
crumbList: state => state.permission.crumbList
}),
classObj() {
return {
hideSidebar: !this.sidebar.opened,
openSidebar: this.sidebar.opened,
withoutAnimation: this.sidebar.withoutAnimation
};
}
},
watch: {
subMenus(val) {
console.log('subMenus change', val);
}
},
methods: {
handleClickOutside() {
this.$store.dispatch('app/closeSideBar', {withoutAnimation: false});
}
}
};
</script>