Merge pull request #545 from nagisa77/feature/first_screen

Feature/first screen
This commit is contained in:
Tim
2025-08-14 14:26:17 +08:00
committed by GitHub
3 changed files with 11 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
</button>
<span v-if="isMobile && unreadCount > 0" class="menu-unread-dot"></span>
</div>
<NuxtLink class="logo-container" :to="homePath">
<NuxtLink class="logo-container" :to="`/`">
<img
alt="OpenIsle"
src="https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/image.png"
@@ -56,10 +56,6 @@ import SearchDropdown from '~/components/SearchDropdown.vue'
import { authState, clearToken, loadCurrentUser } from '~/utils/auth'
import { fetchUnreadCount, notificationState } from '~/utils/notification'
import { useIsMobile } from '~/utils/screen'
import { withBase } from 'ufo'
const homePath = computed(() => withBase('/'))
const props = defineProps({
showMenuBtn: {
type: Boolean,

View File

@@ -1,3 +1,4 @@
import { defineNuxtPlugin } from 'nuxt/app'
import ClickOutside from '~/directives/clickOutside.js'
export default defineNuxtPlugin((nuxtApp) => {

View File

@@ -0,0 +1,9 @@
import { defineNuxtPlugin } from 'nuxt/app'
export default defineNuxtPlugin((nuxtApp) => {
// 覆盖默认行为:收到 manifest 更新时,不立刻在路由切换里刷新
nuxtApp.hooks.hook('app:manifest:update', () => {
// todo 选择:弹个提示,让用户点击刷新;或延迟到页面隐藏时再刷新
// 例如document.addEventListener('visibilitychange', () => { if (document.hidden) location.reload() })
})
})