2025-01-23 01:10:59 +00:00
|
|
|
<!--
|
|
|
|
* @Description:
|
|
|
|
* @Author: zenghua.wang
|
|
|
|
* @Date: 2023-06-20 14:29:45
|
|
|
|
* @LastEditors: zenghua.wang
|
|
|
|
* @LastEditTime: 2024-01-26 23:04:29
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<div class="layout-hamburger" @click="handleCollapse">
|
|
|
|
<el-icon v-if="isCollapse" class="icon"><expand /></el-icon>
|
|
|
|
<el-icon v-else class="icon"><fold /></el-icon>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="layout-hamburger">
|
|
|
|
import { computed } from 'vue';
|
|
|
|
import { useSettingStore } from '@/store/modules/setting';
|
|
|
|
|
|
|
|
const SettingStore = useSettingStore();
|
|
|
|
const isCollapse = computed(() => !SettingStore.isCollapse);
|
|
|
|
|
|
|
|
const handleCollapse = () => {
|
|
|
|
SettingStore.setCollapse(isCollapse.value);
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.layout-hamburger {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2025-02-26 17:03:50 +08:00
|
|
|
padding: 0 15px;
|
|
|
|
height: 100%;
|
2025-01-23 01:10:59 +00:00
|
|
|
&:hover {
|
2025-02-26 17:03:50 +08:00
|
|
|
background: rgb(0 0 0 / 2.5%);
|
2025-01-23 01:10:59 +00:00
|
|
|
}
|
|
|
|
.icon {
|
|
|
|
font-size: 24px;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|