refactor: 删除无用外部样式文件

This commit is contained in:
hxr
2024-02-14 16:44:35 +08:00
parent 6b5c3a7f2a
commit 22e2ba2c2f
7 changed files with 73 additions and 211 deletions

View File

@@ -54,8 +54,4 @@ const logo = ref(new URL(`../../../../assets/logo.png`, import.meta.url).href);
width: $sidebar-width;
}
}
.mobile .logo-container {
width: $sidebar-width-collapsed;
}
</style>

View File

@@ -133,24 +133,57 @@ function resolvePath(routePath: string) {
}
</script>
<style lang="scss" scoped>
.submenu-title-noDropdown {
position: relative;
.el-tooltip {
<style lang="scss">
.hideSidebar {
.submenu-title-noDropdown {
position: relative;
padding: 0 !important;
.sub-el-icon {
margin-left: 19px;
.el-tooltip {
padding: 0 !important;
.sub-el-icon {
margin-left: 19px;
}
}
& > span {
display: inline-block;
width: 0;
height: 0;
overflow: hidden;
visibility: hidden;
}
}
& > span {
display: inline-block;
width: 0;
height: 0;
.el-sub-menu {
overflow: hidden;
visibility: hidden;
& > .el-sub-menu__title {
padding: 0 !important;
.sub-el-icon {
margin-left: 19px;
}
.el-sub-menu__icon-arrow {
display: none;
}
}
}
.el-menu--collapse {
.el-sub-menu {
& > .el-sub-menu__title {
& > span {
display: inline-block;
width: 0;
height: 0;
overflow: hidden;
visibility: hidden;
}
}
}
}
}
</style>

View File

@@ -84,8 +84,8 @@ watch(
const classObj = computed(() => ({
hideSidebar: !appStore.sidebar.opened,
openSidebar: appStore.sidebar.opened,
withoutAnimation: appStore.sidebar.withoutAnimation,
mobile: appStore.device === "mobile",
"layout-left": layout.value === "left",
"layout-top": layout.value === "top",
"layout-mix": layout.value === "mix",
}));
@@ -93,20 +93,20 @@ const classObj = computed(() => ({
watchEffect(() => {
if (width.value < WIDTH) {
appStore.toggleDevice("mobile");
appStore.closeSideBar(true);
appStore.closeSideBar();
} else {
appStore.toggleDevice("desktop");
if (width.value >= 1200) {
appStore.openSideBar(true);
appStore.openSideBar();
} else {
appStore.closeSideBar(true);
appStore.closeSideBar();
}
}
});
function handleOutsideClick() {
appStore.closeSideBar(false);
appStore.closeSideBar();
}
function toggleSidebar() {
@@ -249,6 +249,14 @@ function toggleSidebar() {
}
.hideSidebar {
.sidebar-container {
width: $sidebar-width-collapsed !important;
}
.main-container {
margin-left: $sidebar-width-collapsed;
}
.mix-container__left {
width: $sidebar-width-collapsed;
}
@@ -262,7 +270,19 @@ function toggleSidebar() {
width: 100%;
}
.layout-top {
&.layout-left {
.main-container {
margin-left: 0;
}
.sidebar-container {
pointer-events: none;
transition-duration: 0.3s;
transform: translate3d(-$sidebar-width, 0, 0);
}
}
&.layout-top {
.sidebar-container {
z-index: 999;
display: flex;