perf: layout组件样式优化
This commit is contained in:
@ -121,7 +121,7 @@ export default defineComponent({
|
|||||||
auto-open={false}
|
auto-open={false}
|
||||||
selected-keys={selectedKey.value}
|
selected-keys={selectedKey.value}
|
||||||
auto-open-selected={true}
|
auto-open-selected={true}
|
||||||
level-indent={34}
|
level-indent={24}
|
||||||
style="height: 100%;width:100%;"
|
style="height: 100%;width:100%;"
|
||||||
onCollapse={setCollapse}
|
onCollapse={setCollapse}
|
||||||
>
|
>
|
||||||
@ -132,16 +132,59 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.arco-menu-inner) {
|
:deep(.arco-menu-inner) {
|
||||||
|
padding: 20px 24px 0 12px !important;
|
||||||
.arco-menu-inline-header {
|
.arco-menu-inline-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
height: 40px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
.arco-menu-icon {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.arco-menu-title {
|
||||||
|
color: var(--Text-2, #3c4043);
|
||||||
|
font-family: 'PuHuiTi-Regular';
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 22px; /* 137.5% */
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background: var(--BG-200, #f2f3f5) !important;
|
||||||
|
}
|
||||||
|
&.arco-menu-selected {
|
||||||
|
.arco-menu-title {
|
||||||
|
color: var(--Brand-Brand-6, #6d4cfe) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.arco-icon {
|
.arco-icon {
|
||||||
&:not(.arco-icon-down) {
|
&:not(.arco-icon-down) {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.arco-menu-item {
|
||||||
|
border-radius: 8px;
|
||||||
|
.arco-menu-item-inner {
|
||||||
|
color: var(--Text-3, #737478);
|
||||||
|
font-family: 'PuHuiTi-Regular';
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 22px; /* 137.5% */
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background: var(--BG-200, #f2f3f5) !important;
|
||||||
|
}
|
||||||
|
&.arco-menu-selected {
|
||||||
|
background: var(--Brand-Brand-1, #f0edff) !important;
|
||||||
|
.arco-menu-item-inner {
|
||||||
|
color: var(--Brand-Brand-6, #6d4cfe) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -80,27 +80,34 @@ const handleDopdownClick = (index: any, ind: any) => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div class="left-side">
|
<div class="left-side">
|
||||||
<a-space>
|
<a-space class="cursor-pointer" @click="router.push('/')">
|
||||||
<img src="@/assets/logo.svg" alt="" />
|
<img src="@/assets/logo.svg" alt="" />
|
||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
<div class="center-side">
|
<div class="center-side">
|
||||||
<div class="menu-demo">
|
<div class="menu-demo h-100%">
|
||||||
<a-menu
|
<a-menu
|
||||||
mode="horizontal"
|
mode="horizontal"
|
||||||
:selected-keys="selectedKey"
|
:selected-keys="selectedKey"
|
||||||
:default-selected-keys="[`${MENU_GROUP_IDS.WORK_BENCH_ID}`]"
|
:default-selected-keys="[`${MENU_GROUP_IDS.WORK_BENCH_ID}`]"
|
||||||
>
|
>
|
||||||
|
<template #collapse-icon>
|
||||||
|
<icon-caret-down size="16" />
|
||||||
|
<icon-caret-up size="16" />
|
||||||
|
</template>
|
||||||
<a-menu-item :key="`${MENU_GROUP_IDS.WORK_BENCH_ID}`" @click="handleSelect(0)">
|
<a-menu-item :key="`${MENU_GROUP_IDS.WORK_BENCH_ID}`" @click="handleSelect(0)">
|
||||||
<view>工作台</view>
|
<span class="menu-item-text">工作台</span>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
<a-menu-item v-for="(item, index) in lists" :key="String(item.id)">
|
<a-menu-item v-for="(item, index) in lists" :key="String(item.id)">
|
||||||
<a-dropdown :popup-max-height="false">
|
<a-dropdown :popup-max-height="false" class="layout-menu-item-dropdown">
|
||||||
<a-button>{{ item.name }}<icon-caret-down /></a-button>
|
<a-button>
|
||||||
|
<span class="menu-item-text mr-2px"> {{ item.name }}</span>
|
||||||
|
<icon-caret-down size="16" />
|
||||||
|
</a-button>
|
||||||
<template #content>
|
<template #content>
|
||||||
<a-doption v-for="(child, ind) in item.children" :key="ind" @click="handleDopdownClick(index, ind)">{{
|
<a-doption v-for="(child, ind) in item.children" :key="ind" @click="handleDopdownClick(index, ind)">
|
||||||
child.name
|
<span class="menu-item-text"> {{ child.name }}</span>
|
||||||
}}</a-doption>
|
</a-doption>
|
||||||
</template>
|
</template>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
@ -144,7 +151,7 @@ const handleDopdownClick = (index: any, ind: any) => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="scss">
|
||||||
.navbar {
|
.navbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@ -163,6 +170,40 @@ const handleDopdownClick = (index: any, ind: any) => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
margin-left: 40px;
|
margin-left: 40px;
|
||||||
|
.menu-item-text {
|
||||||
|
color: var(--Text-2, #3c4043);
|
||||||
|
font-family: 'PuHuiTi-Medium';
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
:deep(.arco-menu) {
|
||||||
|
height: 100%;
|
||||||
|
.arco-menu-inner {
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
.arco-menu-item {
|
||||||
|
padding: 0;
|
||||||
|
position: relative;
|
||||||
|
&.arco-menu-selected {
|
||||||
|
.menu-item-text,
|
||||||
|
.arco-menu-selected-label {
|
||||||
|
color: #6d4cfe;
|
||||||
|
}
|
||||||
|
.arco-menu-selected-label {
|
||||||
|
background: var(--Brand-Brand-6, #6d4cfe);
|
||||||
|
height: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
width: 50%;
|
||||||
|
position: absolute;
|
||||||
|
bottom: -8px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.cneter-tip {
|
.cneter-tip {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
@ -192,3 +233,40 @@ const handleDopdownClick = (index: any, ind: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.layout-menu-item-dropdown {
|
||||||
|
.arco-dropdown {
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid var(--BG-300, #e6e6e8);
|
||||||
|
background: var(--BG-white, #fff);
|
||||||
|
padding: 12px 0px;
|
||||||
|
.arco-dropdown-option {
|
||||||
|
padding: 0 12px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
&-content {
|
||||||
|
display: flex;
|
||||||
|
height: 40px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px 24px;
|
||||||
|
align-items: center;
|
||||||
|
.menu-item-text {
|
||||||
|
color: var(--Text-2, #3c4043);
|
||||||
|
font-family: 'PuHuiTi-Regular';
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 22px; /* 137.5% */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:not(.arco-dropdown-option-disabled):hover {
|
||||||
|
background-color: transparent;
|
||||||
|
.arco-dropdown-option-content {
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--BG-200, #f2f3f5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -14,7 +14,7 @@ const route = useRoute();
|
|||||||
console.log({ appStore });
|
console.log({ appStore });
|
||||||
|
|
||||||
useResponsive(true);
|
useResponsive(true);
|
||||||
const navbarHeight = `60px`;
|
const navbarHeight = `72px`;
|
||||||
const navbar = computed(() => appStore.navbar);
|
const navbar = computed(() => appStore.navbar);
|
||||||
const renderMenu = computed(() => appStore.menu && !appStore.topMenu);
|
const renderMenu = computed(() => appStore.menu && !appStore.topMenu);
|
||||||
const hideMenu = computed(() => appStore.hideMenu);
|
const hideMenu = computed(() => appStore.hideMenu);
|
||||||
@ -74,7 +74,7 @@ provide('toggleDrawerMenu', () => {
|
|||||||
breakpoint="xl"
|
breakpoint="xl"
|
||||||
:collapsed="collapsed"
|
:collapsed="collapsed"
|
||||||
:width="menuWidth"
|
:width="menuWidth"
|
||||||
:style="{ paddingTop: navbar ? '60px' : '' }"
|
:style="{ paddingTop: navbar ? '72px' : '' }"
|
||||||
collapsible
|
collapsible
|
||||||
hide-trigger
|
hide-trigger
|
||||||
@collapse="setCollapsed"
|
@collapse="setCollapsed"
|
||||||
@ -107,7 +107,7 @@ provide('toggleDrawerMenu', () => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
@nav-size-height: 60px;
|
@nav-size-height: 72px;
|
||||||
@layout-max-width: 1100px;
|
@layout-max-width: 1100px;
|
||||||
|
|
||||||
.layout {
|
.layout {
|
||||||
|
|||||||
Reference in New Issue
Block a user