优化布局

This commit is contained in:
不做码农 2022-05-20 21:05:35 +08:00
parent fdab552d6b
commit c3c8260f4e
4 changed files with 26 additions and 17 deletions

View File

@ -30,7 +30,7 @@
// 展开sidebar状态设置svg-icon边距 // 展开sidebar状态设置svg-icon边距
.openSidebar { .openSidebar {
.layout-sidebar__container .svg-icon { .layout-sidebar__container .svg-icon {
margin-right: 10px; margin-right: 5px;
} }
} }

View File

@ -18,10 +18,11 @@ $panGreen: #30b08f;
--base-text-color-rgba: rgba(0, 0, 0, 0.85); --base-text-color-rgba: rgba(0, 0, 0, 0.85);
--base-sidebar-width: 220px; --base-sidebar-width: 220px;
--el-aside-width: 220px; --el-aside-width: 220px;
--el-header-height: 50px;
--base-footer-height: 40px; --base-footer-height: 40px;
--base-tags-height: 34px; --base-tags-height: 34px;
--base-header-height: 50px;
} }
/***默认主题颜色配置***/ /***默认主题颜色配置***/
[data-theme='theme-light'] { [data-theme='theme-light'] {
// 菜单背景 // 菜单背景

View File

@ -40,7 +40,6 @@
</template> </template>
<script setup> <script setup>
import { ElMessageBox } from 'element-plus'
import Breadcrumb from '@/components/Breadcrumb' import Breadcrumb from '@/components/Breadcrumb'
import TopNav from '@/components/TopNav' import TopNav from '@/components/TopNav'
import Hamburger from '@/components/Hamburger' import Hamburger from '@/components/Hamburger'
@ -74,9 +73,10 @@ function handleCommand(command) {
} }
function logout() { function logout() {
ElMessageBox.confirm(proxy.$t('layout.logOutConfirm'), proxy.$t('common.tips'), { proxy
confirmButtonText: proxy.$t('common.ok'), .$confirm(proxy.$t('layout.logOutConfirm'), proxy.$t('common.tips'), {
cancelButtonText: proxy.$t('common.cancel'), confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
@ -102,14 +102,15 @@ function setLayout() {
} }
} }
.navbar { .navbar {
// height: 50px; height: var(--base-header-height);
line-height: var(--base-header-height);
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background: var(--base-topBar-background); background: var(--base-topBar-background);
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); // box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
.hamburger-container { .hamburger-container {
line-height: 46px; line-height: var(--base-header-height);
height: 100%; height: 100%;
float: left; float: left;
cursor: pointer; cursor: pointer;
@ -135,8 +136,6 @@ function setLayout() {
} }
.right-menu { .right-menu {
height: 100%;
line-height: 60px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;

View File

@ -13,8 +13,8 @@
@contextmenu.prevent="openMenu(tag, $event)"> @contextmenu.prevent="openMenu(tag, $event)">
<span v-if="tag.meta && tag.meta.titleKey">{{ $t(tag.meta.titleKey) }}</span> <span v-if="tag.meta && tag.meta.titleKey">{{ $t(tag.meta.titleKey) }}</span>
<span v-else>{{ tag.title }}</span> <span v-else>{{ tag.title }}</span>
<span v-if="!isAffix(tag)" @click.prevent.stop="closeSelectedTag(tag)"> <span v-if="!isAffix(tag)" @click.prevent.stop="closeSelectedTag(tag)" style="width: 10px; height: 10px; display: inline-block">
<close class="el-icon-close" style="width: 1em; height: 1em; vertical-align: middle" /> <close class="el-icon-close close" style="width: 1em; height: 1em; vertical-align: middle" />
</span> </span>
</router-link> </router-link>
</scroll-pane> </scroll-pane>
@ -226,7 +226,7 @@ function handleScroll() {
<style lang="scss" scoped> <style lang="scss" scoped>
.tags-view-container { .tags-view-container {
height: 34px; height: var(--base-tags-height);
width: 100%; width: 100%;
background: var(--base-topBar-background); background: var(--base-topBar-background);
// border-bottom: 1px solid #d8dce5; // border-bottom: 1px solid #d8dce5;
@ -244,6 +244,9 @@ function handleScroll() {
font-size: 12px; font-size: 12px;
margin-left: 5px; margin-left: 5px;
margin-top: 4px; margin-top: 4px;
.close {
display: none;
}
&:first-of-type { &:first-of-type {
margin-left: 15px; margin-left: 15px;
} }
@ -253,11 +256,17 @@ function handleScroll() {
&:hover { &:hover {
background-color: var(--el-color-primary); background-color: var(--el-color-primary);
color: #fff; color: #fff;
.close {
display: inline-block !important;
}
} }
&.active { &.active {
background-color: var(--el-color-primary); background-color: var(--el-color-primary);
border-color: var(--el-color-primary); border-color: var(--el-color-primary);
color: #fff; color: #fff;
.close {
display: inline-block !important;
}
&::before { &::before {
content: ''; content: '';
background: #fff; background: #fff;