How to access 'manual visit' functions using Vue 3's <script setup> syntax #1011
Answered
by
ajnsn
stevie-c91
asked this question in
Help (Vue)
-
Hi, Does anyone know how to access these functions when using <script setup>? The examples in the docs return undefined. Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
ajnsn
Dec 15, 2021
Replies: 1 comment 1 reply
-
Hey @stevie-c91 you need to import Inertia, see example below! <script setup>
import { Inertia } from '@inertiajs/inertia';
function visitHelloWorld() {
Inertia.visit('/hello-world');
}
</script> Hope this helps! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
stevie-c91
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @stevie-c91
you need to import Inertia, see example below!
Hope this helps!