6666 type =" button"
6767 class =" btn btn-icon btn-outline md:hidden"
6868 title =" 菜单"
69- @click =" toggleMobileMenu"
69+ aria-haspopup =" dialog"
70+ aria-expanded =" false"
71+ aria-controls =" mobile-drawer"
72+ data-overlay =" #mobile-drawer"
7073 >
7174 <span class =" icon-[tabler--menu] size-5" ></span >
7275 </button >
7376 </div >
7477 </div >
7578 </header >
7679
77- <!-- 移动端导航抽屉 -->
80+ <!-- 移动端导航抽屉 (使用Flyonui的drawer组件) -->
7881 <div
79- class =" drawer-side z-20 md:hidden"
80- :class =" { 'drawer-open': mobileMenuOpen }"
82+ id =" mobile-drawer"
83+ class =" overlay overlay-open:translate-x-0 drawer drawer-start hidden md:hidden"
84+ role =" dialog"
85+ tabindex =" -1"
8186 >
82- <label
83- class =" drawer-overlay"
84- @click =" mobileMenuOpen = false"
85- ></label >
86- <div class =" p-4 w-60 min-h-full bg-base-200 text-base-content" >
87+ <div class =" drawer-header" >
88+ <h3 class =" drawer-title" >导航菜单</h3 >
89+ <button
90+ type =" button"
91+ class =" btn btn-text btn-circle btn-sm absolute end-3 top-3"
92+ aria-label =" 关闭"
93+ data-overlay =" #mobile-drawer"
94+ >
95+ <span class =" icon-[tabler--x] size-5" ></span >
96+ </button >
97+ </div >
98+ <div class =" drawer-body" >
8799 <div class =" flex flex-col gap-2" >
88100 <router-link
89101 to =" /models"
90102 class =" btn"
91103 :class =" [
92104 isModelPage ? 'btn-primary' : 'btn-ghost'
93105 ]"
94- @click = " mobileMenuOpen = false "
106+ data-overlay = " #mobile-drawer "
95107 >
96108 <span class =" icon-[tabler--database] inline-block me-1.5 size-5" ></span >
97109 模型管理
102114 :class =" [
103115 isPromptPage ? 'btn-primary' : 'btn-ghost'
104116 ]"
105- @click = " mobileMenuOpen = false "
117+ data-overlay = " #mobile-drawer "
106118 >
107119 <span class =" icon-[tabler--message-circle] inline-block me-1.5 size-5" ></span >
108120 提示词管理
109121 </router-link >
110122 <!-- 这里可以添加更多导航项 -->
111123 </div >
112124 </div >
125+ <div class =" drawer-footer" >
126+ <button type =" button" class =" btn btn-soft btn-secondary" data-overlay =" #mobile-drawer" >关闭</button >
127+ </div >
113128 </div >
114129
115130 <!-- 页面内容区 -->
@@ -151,11 +166,6 @@ const appVersion = ref('');
151166const modelPath = ref (' ' );
152167const settingsModalRef = ref <InstanceType <typeof SettingsModal > | null >(null );
153168
154- // 切换移动端菜单
155- function toggleMobileMenu() {
156- mobileMenuOpen .value = ! mobileMenuOpen .value ;
157- }
158-
159169// 切换暗色模式
160170function toggleDarkMode() {
161171 darkMode .value = ! darkMode .value ;
@@ -219,26 +229,5 @@ onMounted(async () => {
219229 </script >
220230
221231<style >
222- .drawer-side {
223- position : fixed ;
224- top : 0 ;
225- left : -100% ;
226- width : 100% ;
227- height : 100% ;
228- transition : left 0.3s ease ;
229- }
230-
231- .drawer-side.drawer-open {
232- left : 0 ;
233- }
234-
235- .drawer-overlay {
236- position : fixed ;
237- top : 0 ;
238- left : 0 ;
239- width : 100% ;
240- height : 100% ;
241- background-color : rgba (0 , 0 , 0 , 0.5 );
242- z-index : -1 ;
243- }
232+ /* 不再需要自定义抽屉样式,使用FlyonUI标准抽屉组件 */
244233 </style >
0 commit comments