<!-- 工具栏：折叠/展开菜单栏按钮 -->
<template>
    <span title="折叠 / 展开" class="tool-fox" @click="changeOpen()">
        <el-icon
            style="transition: all 0.2s;"
            :style="appStore.isOpen ? 'transform: rotate(0deg)' : 'transform: rotate(-180deg)'">
            <el-icon-Fold />
        </el-icon>
    </span>
</template>

<script setup name="nav-tool-fold">
import {useAppStore} from "../../../store/app";

const appStore = useAppStore();


// 切换菜单栏的打开和关闭
const changeOpen = function () {
    if(appStore.isOpen) {
        appStore.endOpen();
    } else {
        appStore.startOpen();
    }
}

</script>

<style scoped>

</style>
