@vincej You're importing the router incorrectly. Do:
import { router } from "@inertiajs/vue3";
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am trying to pass data back to my controller. I have installed the new Inertia 1.0 . To that end I have entered into the script, import router from '@inertiajs/vue3'. According Jeffrey's tutorial on inertia all should have to do is import inertia into my Vue 3 script and then do an Inertia.post(),
If you use Inertia.post() you get an error in he Chrome console :
Uncaught ReferenceError: Inertia is not defined
So, I changed it to router.post() however, with the new router function nothing is working. I get an error,
export 'default' (imported as 'router') was not found in '@inertiajs/vue3' (possible exports: Head, Link, createInertiaApp, router, useForm, usePage, useRemember)
I post my code below. FYI I am getting all the data through on this.changedChild
Any ideas?? Many thanks!
<script>
import router from '@inertiajs/vue3'
export default {
props: {
Children:{
Children:Array
},
},
data() {
return {
active:false,
inputClass: 'present',
absentPresent:'Absent/Present'
}
},
methods:{
updateChild(child){
this.changedChild = child;
console.log( this.changedChild);
this.inputClass = 'present'
this.active = ! this.active
Inertia.post('/updateChild',this.changedChild) // THIS DOES NOT WORK
},
},
}
</script>
Please or to participate in this conversation.