优化代码

This commit is contained in:
不做码农 2022-07-10 14:50:14 +08:00
parent ea421f92bf
commit c61bc792f2
2 changed files with 6 additions and 10 deletions

View File

@ -8,9 +8,9 @@
<div class="right-menu">
<header-search id="header-search" class="right-menu-item" v-if="appStore.device != 'mobile'" />
<zr-git title="源码地址" class="right-menu-item" />
<zr-doc title="文档地址" class="right-menu-item" />
<screenfull title="全屏" class="right-menu-item" />
<zr-git title="源码地址" class="right-menu-item" v-if="appStore.device != 'mobile'" />
<zr-doc title="文档地址" class="right-menu-item" v-if="appStore.device != 'mobile'" />
<screenfull title="全屏" class="right-menu-item" v-if="appStore.device != 'mobile'" />
<size-select title="布局大小" class="right-menu-item" />
<LangSelect title="语言设置" class="right-menu-item" />
<Notice title="通知" class="right-menu-item" />

View File

@ -41,7 +41,7 @@ const menuDrawer = computed({
get: () => useAppStore().sidebar.opened,
set: (val) => {
useAppStore().toggleSideBar(val)
},
}
})
const settingsStore = useSettingsStore()
const theme = computed(() => settingsStore.theme)
@ -62,11 +62,11 @@ const cachedViews = computed(() => {
const classObj = computed(() => ({
hideSidebar: !sidebar.value.opened,
openSidebar: sidebar.value.opened,
mobile: device.value === 'mobile',
mobile: device.value === 'mobile'
}))
const { width, height } = useWindowSize()
const WIDTH = 992 // refer to Bootstrap's responsive design
const WIDTH = 592 // refer to Bootstrap's responsive design
watchEffect(() => {
if (device.value === 'mobile' && sidebar.value.opened) {
@ -80,10 +80,6 @@ watchEffect(() => {
}
})
function handleClickOutside() {
useAppStore().closeSideBar()
}
const settingRef = ref(null)
function setLayout() {
settingRef.value.openSetting()