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