优化topbar样式

This commit is contained in:
不做码农
2022-04-28 08:24:38 +08:00
parent 845f0aca95
commit 932d963b61
5 changed files with 94 additions and 126 deletions
+21 -23
View File
@@ -1,9 +1,7 @@
<template>
<div>
<el-dropdown trigger="click" @command="handleSetSize">
<div class="size-icon--style">
<svg-icon class-name="size-icon" icon-class="size" />
</div>
<el-dropdown trigger="hover" @command="handleSetSize" style="vertical-align: middle">
<svg-icon class-name="size-icon" icon-class="size" />
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item v-for="item of sizeOptions" :key="item.value" :disabled="size === item.value" :command="item.value">
@@ -16,40 +14,40 @@
</template>
<script setup>
const store = useStore();
const size = computed(() => store.getters.size);
const route = useRoute();
const router = useRouter();
const { proxy } = getCurrentInstance();
const store = useStore()
const size = computed(() => store.getters.size)
const route = useRoute()
const router = useRouter()
const { proxy } = getCurrentInstance()
const sizeOptions = ref([
{ label: "较大", value: "large" },
{ label: "默认", value: "default" },
{ label: "稍小", value: "small" },
]);
{ label: '较大', value: 'large' },
{ label: '默认', value: 'default' },
{ label: '稍小', value: 'small' },
])
function refreshView() {
// In order to make the cached page re-rendered
store.dispatch("tagsView/delAllCachedViews", route);
store.dispatch('tagsView/delAllCachedViews', route)
const { fullPath } = route;
const { fullPath } = route
nextTick(() => {
router.replace({
path: "/redirect" + fullPath,
});
});
path: '/redirect' + fullPath,
})
})
}
function handleSetSize(size) {
proxy.$modal.loading("正在设置布局大小,请稍候...");
store.dispatch("app/setSize", size);
setTimeout("window.location.reload()", 1000);
proxy.$modal.loading('正在设置布局大小,请稍候...')
store.dispatch('app/setSize', size)
setTimeout('window.location.reload()', 1000)
}
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.size-icon--style {
font-size: 18px;
line-height: 50px;
padding-right: 7px;
}
</style>
</style>