|
|
@@ -5,11 +5,13 @@ import { useStorage } from '@vueuse/core';
|
|
|
import { ref, reactive, computed } from 'vue';
|
|
|
|
|
|
export const useAppStore = defineStore('app', () => {
|
|
|
- const sidebarStatus = useStorage('sidebarStatus', '1');
|
|
|
+ // 默认隐藏侧边栏(首次打开页面时不渲染侧边栏)
|
|
|
+ const sidebarStatus = useStorage('sidebarStatus', '0');
|
|
|
+
|
|
|
const sidebar = reactive({
|
|
|
- opened: sidebarStatus.value ? !!+sidebarStatus.value : true,
|
|
|
+ opened: false,
|
|
|
withoutAnimation: false,
|
|
|
- hide: false
|
|
|
+ hide: true
|
|
|
});
|
|
|
const device = ref<string>('desktop');
|
|
|
const size = useStorage<'large' | 'default' | 'small'>('size', 'default');
|