mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-21 22:41:05 +08:00
fix: ensure router composable initialized before async
This commit is contained in:
@@ -127,6 +127,9 @@ export default {
|
||||
}
|
||||
},
|
||||
async setup(props, { emit }) {
|
||||
// `useRouter` must be called before any `await` to retain Nuxt instance
|
||||
const router = useRouter()
|
||||
|
||||
const categories = ref([])
|
||||
const tags = ref([])
|
||||
const categoryOpen = ref(true)
|
||||
@@ -190,8 +193,6 @@ export default {
|
||||
watch(() => authState.loggedIn, updateCount)
|
||||
})
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const handleHomeClick = () => {
|
||||
router.push('/').then(() => {
|
||||
window.location.reload()
|
||||
|
||||
Reference in New Issue
Block a user