参考https://blog.csdn.net/weixin_48508049/article/details/114018306
在 src/style/sidebar.scss 里搜索hideSidebar找到以下部分
.hideSidebar {
.sidebar-container {
width: 54px !important;
}
.main-container {
margin-left: 54px;
}
修改为
.sidebar-container {
width: 54px !important;
pointer-events: none;
transition-duration: 0.3s;
transform: translate3d(-$sideBarWidth, 0, 0);
}
.main-container {
margin-left: 0px;
}
此时电脑端侧边栏位置会显示一块空白部分
解决办法
在 src\layout\components\index.js 里注释掉侧边栏部分
export { default as AppMain } from './AppMain'
export { default as Navbar } from './Navbar'
export { default as Settings } from './Settings'
// export { default as Sidebar } from './Sidebar/index.vue'
export { default as TagsView } from './TagsView/index.vue'
侧边栏彻底隐藏成功