mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-07 23:51:17 +08:00
Compare commits
6 Commits
codex/fix-
...
feature/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22693bfdd9 | ||
|
|
304d941d68 | ||
|
|
2efe4e733a | ||
|
|
cb49dc9b73 | ||
|
|
1dc13698ad | ||
|
|
d58432dcd9 |
@@ -8,7 +8,7 @@
|
||||
</button>
|
||||
<span v-if="isMobile && unreadCount > 0" class="menu-unread-dot"></span>
|
||||
</div>
|
||||
<NuxtLink class="logo-container" to="/" replace @click="handleLogoClick">
|
||||
<NuxtLink class="logo-container" :to="`/`">
|
||||
<img
|
||||
alt="OpenIsle"
|
||||
src="https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/image.png"
|
||||
@@ -51,7 +51,6 @@
|
||||
<script setup>
|
||||
import { ClientOnly } from '#components'
|
||||
import { computed, nextTick, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import DropdownMenu from '~/components/DropdownMenu.vue'
|
||||
import SearchDropdown from '~/components/SearchDropdown.vue'
|
||||
import { authState, clearToken, loadCurrentUser } from '~/utils/auth'
|
||||
@@ -67,19 +66,12 @@ const props = defineProps({
|
||||
const isLogin = computed(() => authState.loggedIn)
|
||||
const isMobile = useIsMobile()
|
||||
const unreadCount = computed(() => notificationState.unreadCount)
|
||||
const router = useRouter()
|
||||
const avatar = ref('')
|
||||
const showSearch = ref(false)
|
||||
const searchDropdown = ref(null)
|
||||
const userMenu = ref(null)
|
||||
const menuBtn = ref(null)
|
||||
|
||||
const handleLogoClick = (event) => {
|
||||
if (router.currentRoute.value.fullPath === '/') {
|
||||
event.preventDefault()
|
||||
window.dispatchEvent(new Event('refresh-home'))
|
||||
}
|
||||
}
|
||||
const search = () => {
|
||||
showSearch.value = true
|
||||
nextTick(() => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<transition name="slide">
|
||||
<nav v-if="visible" class="menu">
|
||||
<div class="menu-item-container">
|
||||
<NuxtLink class="menu-item" exact-active-class="selected" to="/" @click="handleHomeClick">
|
||||
<NuxtLink class="menu-item" exact-active-class="selected" to="/" @click="handleItemClick">
|
||||
<i class="menu-item-icon fas fa-hashtag"></i>
|
||||
<span class="menu-item-text">话题</span>
|
||||
</NuxtLink>
|
||||
@@ -191,10 +191,6 @@ onMounted(async () => {
|
||||
watch(() => authState.loggedIn, updateCount)
|
||||
})
|
||||
|
||||
const handleHomeClick = () => {
|
||||
navigateTo('/', { replace: true })
|
||||
}
|
||||
|
||||
const handleItemClick = () => {
|
||||
if (window.innerWidth <= 768) emit('item-click')
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ export default defineNuxtConfig({
|
||||
},
|
||||
],
|
||||
},
|
||||
baseURL: '/',
|
||||
buildAssetsDir: '/_nuxt/',
|
||||
},
|
||||
vue: {
|
||||
compilerOptions: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { defineNuxtPlugin } from 'nuxt/app'
|
||||
import ClickOutside from '~/directives/clickOutside.js'
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
|
||||
9
frontend_nuxt/plugins/soft-manifest.client.ts
Normal file
9
frontend_nuxt/plugins/soft-manifest.client.ts
Normal 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() })
|
||||
})
|
||||
})
|
||||
@@ -1,7 +0,0 @@
|
||||
export default {
|
||||
push(path) {
|
||||
if (process.client) {
|
||||
window.location.href = path
|
||||
}
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user