refactor(project): Reorganize frontend and backend directories
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const useAppStore = defineStore('admin-app', () => {
|
||||
// 侧边栏折叠状态
|
||||
const sidebarCollapsed = ref(false)
|
||||
|
||||
// 设备类型
|
||||
const device = ref<'desktop' | 'mobile'>('desktop')
|
||||
|
||||
// 切换侧边栏
|
||||
function toggleSidebar() {
|
||||
sidebarCollapsed.value = !sidebarCollapsed.value
|
||||
}
|
||||
|
||||
// 设置设备类型
|
||||
function setDevice(d: 'desktop' | 'mobile') {
|
||||
device.value = d
|
||||
if (d === 'mobile') {
|
||||
sidebarCollapsed.value = true
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
sidebarCollapsed,
|
||||
device,
|
||||
toggleSidebar,
|
||||
setDevice
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user