fix: the collapsed problem of drawer menu; 🐛 #114

修复:抽屉菜单折叠问题;
master
iczer 4 years ago
parent 5a65032772
commit 6a3ec944c6
  1. 10
      src/layouts/AdminLayout.vue

@ -1,6 +1,6 @@
<template> <template>
<a-layout :class="['admin-layout', 'beauty-scroll']"> <a-layout :class="['admin-layout', 'beauty-scroll']">
<drawer v-if="isMobile" v-model="collapsed"> <drawer v-if="isMobile" v-model="drawerOpen">
<side-menu :theme="theme.mode" :menuData="menuData" :collapsed="false" :collapsible="false" @menuSelect="onMenuSelect"/> <side-menu :theme="theme.mode" :menuData="menuData" :collapsed="false" :collapsible="false" @menuSelect="onMenuSelect"/>
</drawer> </drawer>
<side-menu :class="[fixedSideBar ? 'fixed-side' : '']" :theme="theme.mode" v-else-if="layout === 'side' || layout === 'mix'" :menuData="sideMenuData" :collapsed="collapsed" :collapsible="true" /> <side-menu :class="[fixedSideBar ? 'fixed-side' : '']" :theme="theme.mode" v-else-if="layout === 'side' || layout === 'mix'" :menuData="sideMenuData" :collapsed="collapsed" :collapsible="true" />
@ -43,7 +43,8 @@ export default {
return { return {
minHeight: minHeight, minHeight: minHeight,
collapsed: false, collapsed: false,
showSetting: false showSetting: false,
drawerOpen: false
} }
}, },
watch: { watch: {
@ -52,6 +53,11 @@ export default {
}, },
layout() { layout() {
this.setActivated(this.$route) this.setActivated(this.$route)
},
isMobile(val) {
if(!val) {
this.drawerOpen = false
}
} }
}, },
computed: { computed: {

Loading…
Cancel
Save