You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
771 B
Vue

<script setup lang="ts">
import { triggerWindowResize } from '~/utils'
const { getShowMenu, setMenuSetting } = useMenuSetting()
const { getShowHeader, setHeaderSetting } = useHeaderSetting()
const getIsUnFoldRef = computed(() => !unref(getShowMenu) && !unref(getShowHeader))
const getIconRef = computed(() => unref(getIsUnFoldRef) ? 'codicon:screen-normal' : 'codicon:screen-full')
function handleFold() {
// 设置菜单和头部是否显示
const show = unref(getIsUnFoldRef)
setMenuSetting({ show })
setHeaderSetting({ show })
triggerWindowResize()
}
</script>
<template>
<div
class="h-full w-32px flex-center cursor-pointer border-l border-[var(--border-color)]"
@click="handleFold"
>
<LIcon :icon="getIconRef" />
</div>
</template>