Skip to content

Commit 2100bbe

Browse files
committed
feat: 刷新按钮增加按住ctrl使用原生浏览器刷新功能
1 parent 39ba382 commit 2100bbe

File tree

1 file changed

+18
-3
lines changed
  • src/layouts/components/Topbar/Toolbar/PageReload

1 file changed

+18
-3
lines changed

‎src/layouts/components/Topbar/Toolbar/PageReload/index.vue‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<script setup lang="ts">
2+
import useSettingsStore from '@/store/modules/settings'
3+
24
defineOptions({
35
name: 'PageReload',
46
})
57
8+
const settingsStore = useSettingsStore()
69
const mainPage = useMainPage()
710
811
const isAnimating = ref(false)
@@ -11,12 +14,24 @@ function handleClick() {
1114
isAnimating.value = true
1215
mainPage.reload()
1316
}
17+
18+
function handleCtrlClick() {
19+
location.reload()
20+
}
1421
</script>
1522

1623
<template>
17-
<FaButton variant="ghost" size="icon" @click="handleClick" @animationend="isAnimating = false">
18-
<FaIcon name="i-iconoir:refresh-double" class="size-4" :class="{ animation: isAnimating }" />
19-
</FaButton>
24+
<FaTooltip side="bottom" :disabled="settingsStore.os !== 'mac'">
25+
<template #content>
26+
<div class="flex-col-center gap-2">
27+
<p>按住 <FaKbd>Ctrl</FaKbd> 键并点击</p>
28+
<p>可切换为浏览器原生刷新</p>
29+
</div>
30+
</template>
31+
<FaButton variant="ghost" size="icon" @click.exact="handleClick" @click.ctrl.exact="handleCtrlClick" @animationend="isAnimating = false">
32+
<FaIcon name="i-iconoir:refresh-double" class="size-4" :class="{ animation: isAnimating }" />
33+
</FaButton>
34+
</FaTooltip>
2035
</template>
2136

2237
<style scoped>

0 commit comments

Comments
 (0)