style: layout

This commit is contained in:
xiaoxian521 2021-12-11 11:04:00 +08:00
parent 113e5f9db2
commit 7811f6bdeb
4 changed files with 1486 additions and 3306 deletions

View File

@ -29,7 +29,7 @@
], ],
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
"@element-plus/icons": "^0.0.11", "@element-plus/icons-vue": "^0.2.4",
"@fortawesome/fontawesome-svg-core": "^1.2.36", "@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/vue-fontawesome": "^3.0.0-5", "@fortawesome/vue-fontawesome": "^3.0.0-5",
@ -43,7 +43,7 @@
"cropperjs": "^1.5.11", "cropperjs": "^1.5.11",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"echarts": "^5.2.1", "echarts": "^5.2.1",
"element-plus": "1.2.0-beta.3", "element-plus": "1.2.0-beta.6",
"element-resize-detector": "^1.2.3", "element-resize-detector": "^1.2.3",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
@ -112,7 +112,7 @@
"stylelint-config-standard": "22.0.0", "stylelint-config-standard": "22.0.0",
"stylelint-order": "4.1.0", "stylelint-order": "4.1.0",
"typescript": "4.4.2", "typescript": "4.4.2",
"unplugin-element-plus": "^0.1.0", "unplugin-element-plus": "^0.1.3",
"vite": "2.6.14", "vite": "2.6.14",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.6",
"vite-plugin-style-import": "^1.2.1", "vite-plugin-style-import": "^1.2.1",

4712
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -48,24 +48,8 @@ import {
ElInfiniteScroll ElInfiniteScroll
} from "element-plus"; } from "element-plus";
// https://element-plus.org/zh-CN/component/icon.html // Directives
import { const plugins = [ElLoading, ElInfiniteScroll];
Check,
Menu,
HomeFilled,
SetUp,
Edit,
Setting,
Lollipop,
Link,
Position,
Histogram,
RefreshRight,
ArrowDown,
Close,
CloseBold,
Bell
} from "@element-plus/icons";
const components = [ const components = [
ElTag, ElTag,
@ -112,7 +96,27 @@ const components = [
ElCollapse, ElCollapse,
ElCollapseItem ElCollapseItem
]; ];
// icon
// https://element-plus.org/zh-CN/component/icon.html
import {
Check,
Menu,
HomeFilled,
SetUp,
Edit,
Setting,
Lollipop,
Link,
Position,
Histogram,
RefreshRight,
ArrowDown,
Close,
CloseBold,
Bell
} from "@element-plus/icons-vue";
// Icon
export const iconComponents = [ export const iconComponents = [
Check, Check,
Menu, Menu,
@ -131,14 +135,17 @@ export const iconComponents = [
Bell Bell
]; ];
const plugins = [ElLoading, ElInfiniteScroll];
export function useElementPlus(app: App) { export function useElementPlus(app: App) {
components.push(...iconComponents); // 注册组件
components.forEach((component: Component) => { components.forEach((component: Component) => {
app.component(component.name, component); app.component(component.name, component);
}); });
// 注册指令
plugins.forEach(plugin => { plugins.forEach(plugin => {
app.use(plugin); app.use(plugin);
}); });
// 注册图标
iconComponents.forEach((component: Component) => {
app.component(component.name, component);
});
} }

View File

@ -124,6 +124,12 @@
&:hover { &:hover {
color: $menuTitleHover !important; color: $menuTitleHover !important;
} }
div,
span {
height: 50px;
line-height: 50px;
}
} }
.submenu-title-noDropdown, .submenu-title-noDropdown,
@ -486,7 +492,7 @@
> .el-sub-menu__title::before { > .el-sub-menu__title::before {
position: absolute; position: absolute;
top: 0; top: 0;
left: 5px; left: 0;
width: 3px; width: 3px;
height: 100%; height: 100%;
background-color: $menuActiveBefore; background-color: $menuActiveBefore;
@ -502,7 +508,6 @@
.el-menu--collapse .is-active.submenu-title-noDropdown.outer-most::before { .el-menu--collapse .is-active.submenu-title-noDropdown.outer-most::before {
position: absolute; position: absolute;
top: 0; top: 0;
left: 5px;
width: 3px; width: 3px;
height: 100%; height: 100%;
background-color: $menuActiveBefore; background-color: $menuActiveBefore;
@ -563,6 +568,9 @@
body[layout="vertical"] { body[layout="vertical"] {
$sideBarWidth: 210px; $sideBarWidth: 210px;
@include merge-style($sideBarWidth); @include merge-style($sideBarWidth);
.el-menu--collapse {
width: 54px;
}
.sidebar-logo-container { .sidebar-logo-container {
background: $sidebarLogo; background: $sidebarLogo;
@ -603,8 +611,6 @@ body[layout="vertical"] {
/* 菜单折叠 */ /* 菜单折叠 */
.el-menu--collapse { .el-menu--collapse {
margin-left: -5px;
.el-sub-menu { .el-sub-menu {
& > .el-sub-menu__title { & > .el-sub-menu__title {
& > span { & > span {
@ -617,6 +623,15 @@ body[layout="vertical"] {
} }
} }
/* 无子菜单 */
.el-menu-item [class^="el-icon"] {
right: 5px;
}
.el-sub-menu__title [class^="el-icon"] {
right: 2px;
}
.submenu-title-noDropdown { .submenu-title-noDropdown {
background: transparent !important; background: transparent !important;
} }