Demo:优化主题侧边栏的交互

This commit is contained in:
wanglin2 2025-04-05 21:01:38 +08:00
parent 121eba1799
commit cd2d5943c2

View File

@ -1,7 +1,7 @@
<template> <template>
<Sidebar ref="sidebar" :title="$t('theme.title')"> <Sidebar ref="sidebar" :title="$t('theme.title')">
<div class="themeList" :class="{ isDark: isDark }"> <div class="themeGroupList" :class="{ isDark: isDark }">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName" class="tabBox">
<el-tab-pane <el-tab-pane
v-for="group in groupList" v-for="group in groupList"
:key="group.name" :key="group.name"
@ -9,6 +9,7 @@
:name="group.name" :name="group.name"
></el-tab-pane> ></el-tab-pane>
</el-tabs> </el-tabs>
<div class="themeListTheme customScrollbar">
<div <div
class="themeItem" class="themeItem"
v-for="item in currentList" v-for="item in currentList"
@ -22,6 +23,7 @@
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
</div> </div>
</div> </div>
</div>
</Sidebar> </Sidebar>
</template> </template>
@ -205,9 +207,11 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.themeList { .themeGroupList {
padding: 20px; display: flex;
padding-top: 0; flex-direction: column;
overflow: hidden;
height: 100%;
&.isDark { &.isDark {
.name { .name {
@ -215,6 +219,20 @@ export default {
} }
} }
.tabBox {
flex-shrink: 0;
/deep/ .el-tabs__nav-wrap {
display: flex;
justify-content: center;
}
}
.themeListTheme {
height: 100%;
overflow-y: auto;
padding: 0 20px;
.themeItem { .themeItem {
width: 100%; width: 100%;
cursor: pointer; cursor: pointer;
@ -251,5 +269,6 @@ export default {
font-size: 14px; font-size: 14px;
} }
} }
}
} }
</style> </style>