Replies: 1 comment 8 replies
-
Use the <script>
import { computed } from 'vue'
import { usePage } from '@inertiajs/inertia-vue3'
export default {
setup() {
const url = usePage().url
},
}
</script> |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am new to Inertia js, i am following the official documentation and PINGCRM's code to learn it. I want to make use of Vue 3 Composition API. In my Layout.vue file, i have the following code to check if the url is active:
While trying to do so i am getting the following error:
app.js:22025 Uncaught (in promise) TypeError: Cannot read property '$page' of undefined
I looked in the official documentation but was unable to find the solution for this.
Beta Was this translation helpful? Give feedback.
All reactions