mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 15:28:36 +08:00
refactor: 优化mac系统下快捷键键位展示
This commit is contained in:
@@ -18,15 +18,15 @@ onMounted(() => {
|
||||
<el-drawer v-model="isShow" title="快捷键介绍" direction="rtl" :size="360">
|
||||
<el-descriptions title="全局" :column="1" border>
|
||||
<el-descriptions-item label="查看系统信息">
|
||||
Alt + I
|
||||
{{ settingsStore.os === 'mac' ? '⌥' : 'Alt' }} + I
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item v-if="settingsStore.settings.navSearch.enable && settingsStore.settings.navSearch.enableHotkeys" label="唤起导航搜索">
|
||||
Alt + S
|
||||
{{ settingsStore.os === 'mac' ? '⌥' : 'Alt' }} + S
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions v-if="settingsStore.settings.menu.enableHotkeys && ['side', 'head'].includes(settingsStore.settings.menu.menuMode)" title="主导航" :column="1" border>
|
||||
<el-descriptions-item label="激活下一个主导航">
|
||||
Alt + `
|
||||
{{ settingsStore.os === 'mac' ? '⌥' : 'Alt' }} + `
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-drawer>
|
||||
|
||||
@@ -248,7 +248,7 @@ function pageJump(path: listTypes['path'], link: listTypes['link']) {
|
||||
<div v-if="settingsStore.mode === 'pc'" class="tips">
|
||||
<div class="tip">
|
||||
<el-tag type="info" size="large">
|
||||
Alt + S
|
||||
{{ settingsStore.os === 'mac' ? '⌥' : 'Alt' }} + S
|
||||
</el-tag>
|
||||
<el-tag type="info" size="large">
|
||||
唤醒搜索面板
|
||||
|
||||
@@ -31,6 +31,21 @@ const useSettingsStore = defineStore(
|
||||
immediate: true,
|
||||
})
|
||||
|
||||
// 操作系统
|
||||
const os = ref<'mac' | 'windows' | 'linux' | 'other'>('other')
|
||||
const agent = navigator.userAgent.toLowerCase()
|
||||
switch (true) {
|
||||
case agent.includes('mac os'):
|
||||
os.value = 'mac'
|
||||
break
|
||||
case agent.includes('windows'):
|
||||
os.value = 'windows'
|
||||
break
|
||||
case agent.includes('linux'):
|
||||
os.value = 'linux'
|
||||
break
|
||||
}
|
||||
|
||||
// 页面标题
|
||||
const title = ref<RouteMeta['title']>()
|
||||
// 设置网页标题
|
||||
@@ -92,6 +107,7 @@ const useSettingsStore = defineStore(
|
||||
|
||||
return {
|
||||
settings,
|
||||
os,
|
||||
title,
|
||||
setTitle,
|
||||
mode,
|
||||
|
||||
Reference in New Issue
Block a user