index.vue
1 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
<template lang="pug">
.app
el-container
el-aside(:width="asideWidth")
sidebar
el-container
el-header(height='118px')
Header
Breadcrumb
el-main
AppMain
</template>
<script>
import { Sidebar, AppMain, Header } from './components'
import Breadcrumb from './components/breadcrumb'
import { mapState } from 'vuex'
export default {
name: 'Layout',
components: {
Sidebar,
Header,
AppMain,
Breadcrumb
},
computed: {
...mapState('app', ['sidebar']),
siderbar() {
return this.$store.state.app.siderbar
},
asideWidth() {
return this.sidebar.opened ? '64px' : '256px'
}
}
}
</script>
<style lang="scss" scope>
.app {
height: 100%;
> .el-container {
height: 100%;
}
.el-header {
padding: 0;
}
.el-main {
padding: 24px 24px 0 24px;
background-color: #f0f2f5;
}
.el-aside {
transition: width 0.2s ease-in;
box-shadow: 2px 0px 6px 0px rgba(0, 21, 41, 0.35);
}
}
</style>