-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
i konw now called useRouter() msut be inside of setup().
when i try use vue function component with JSX, is every flexable, but this code pattern can't use useRouter(), a little regret 😶.
hope next version can consider function component pattern 😁
thanks all, thanks vue-router team.
import { ref } from "vue"
import { useRouter } from 'vue-router'
const num = ref(0)
const router = useRouter();
export const Test = (props, ctx) => {
return (
<div onClick={() => router.push('/login') }>
test {num.value}
</div>
)
}Metadata
Metadata
Assignees
Labels
No labels