feat: fold/expand menu

This commit is contained in:
yangsy
2025-11-28 00:13:05 +08:00
parent 7f9d868643
commit fb7657f99c
3 changed files with 39 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ import { getAppEnvConfig } from '@/utils';
import { useQueryClient } from '@tanstack/vue-query';
import { useEventListener } from '@vueuse/core';
import axios from 'axios';
import { NButton, NDivider, NDrawer, NDrawerContent, NFlex, NFormItem, NInput, NInputNumber, NModal, NRadio, NRadioGroup, NText } from 'naive-ui';
import { NButton, NDivider, NDrawer, NDrawerContent, NFlex, NFormItem, NInput, NInputNumber, NModal, NRadio, NRadioGroup, NSwitch, NText } from 'naive-ui';
import { storeToRefs } from 'pinia';
import { onMounted, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
@@ -17,7 +17,7 @@ const route = useRoute();
const show = defineModel<boolean>('show');
const settingStore = useSettingStore();
const { stationGridColumns, debugModeEnabled } = storeToRefs(settingStore);
const { stationGridColumns, debugModeEnabled, menuCollpased } = storeToRefs(settingStore);
const pollingStore = usePollingStore();
const { stationVerifyMode } = storeToRefs(pollingStore);
@@ -68,8 +68,11 @@ useEventListener('keydown', (event) => {
<NFormItem label="深色模式" label-placement="left">
<ThemeSwitch />
</NFormItem>
<NDivider>布局</NDivider>
<NFormItem label="折叠菜单" label-placement="left">
<NSwitch v-model:value="menuCollpased" />
</NFormItem>
<template v-if="route.path === '/station'">
<NDivider>布局</NDivider>
<NFormItem label="车站列数" label-placement="left">
<NInputNumber v-model:value="stationGridColumns" :min="1" :max="10" />
</NFormItem>