You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-admin/src/layouts/components/header.vue

49 lines
1.4 KiB

<template>
<div class="layout-header">
<div class="header-left">
<el-icon :name="collapseMenu ? 'menu-unfold-fill' : 'menu-fold-fill'" size="16" @click="handleCollapse" />
<LayoutBreakcrumb />
</div>
<div class="header-right">
<LayoutOperation />
<LayoutProfile />
</div>
</div>
</template>
<script setup>
import LayoutBreakcrumb from './breakcrumb.vue';
import LayoutProfile from './profile.vue';
import LayoutOperation from './operation.vue';
const store = useStore();
const collapseMenu = computed(() => store.getters['layout/collapseMenu']);
const handleCollapse = () => {
store.commit('layout/setCollapseMenu', !unref(collapseMenu));
};
</script>
<style lang="less" scoped>
.layout-header {
width: 100%;
flex-shrink: 0;
display: flex;
align-items: center;
background-color: @layout-header-bgc;
color: @layout-header-fc;
.header-left,
.header-right {
height: @layout-header-height;
padding: 0 @layout-space-large;
display: flex;
align-items: center;
}
.header-right {
margin-left: auto;
}
.x-icon {
border-radius: @layout-border-radius;
cursor: pointer;
}
}
</style>