<div :class="classObj" class="app-wrapper">
主要的是classObj 这个对象
然后在计算属性中
computed: {
currentRoute() {
return this.$route.path
},
sidebar() {
return this.$store.state.app.sidebar
},
device() {
return this.$store.state.app.device
},
fixedHeader() {
return this.$store.state.settings.fixedHeader
},
classObj() {
return {
hideSidebar: !this.sidebar.opened,
openSidebar: this.sidebar.opened,
}
},
...mapGetters([
'sidebar'
])
},
在样式里面写 两个不同的样式
.hideSidebar .bread_container{
left:74px;
}
.openSidebar{
position: fixed;
top: 0;
}
3989

被折叠的 条评论
为什么被折叠?



