toggle menu class

This commit is contained in:
2026-06-16 09:19:33 +08:00
parent f1b4b54e19
commit b8eff40c00
2 changed files with 8 additions and 2 deletions
+7 -2
View File
@@ -1,9 +1,9 @@
<template>
<aside class="sidebar" :class="{ collapsed }">
<div class="sidebar-header">
<h2 class="sidebar-title" @click="$router.push('/')">
<h2 class="sidebar-title" @click="$router.push('/')" v-show="!collapsed">
<span class="logo">📚</span>
<span v-show="!collapsed">算法分析教学</span>
<span>算法分析教学</span>
</h2>
<button class="toggle-btn" @click="$emit('toggle')">
{{ collapsed ? '' : '' }}
@@ -67,6 +67,11 @@ defineEmits(['toggle'])
justify-content: space-between;
}
.sidebar.collapsed .sidebar-header {
padding: 16px 8px;
justify-content: center;
}
.sidebar-title {
font-size: 16px;
cursor: pointer;
+1
View File
@@ -5,6 +5,7 @@ import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
server: {
port: 1025,
proxy: {
'/api': {
target: 'http://localhost:3001',