Merge pull request #435 from nagisa77/codex/fix-composable-usage-outside-of-valid-context

This commit is contained in:
Tim
2025-08-08 13:57:52 +08:00
committed by GitHub

View File

@@ -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()