this is my Html template
I am new to inertia js here I am trying to submit the data with the method 'submit' I don't know why it's not defined
<script>
import AppLayout from '@/Layouts/AppLayout'
//import Welcome from '@/Jetstream/Welcome'
export default {
components: {
AppLayout,
},
data(){
return{
reactive:true,
form:{
course_title: null,
about:null
}
}
},
method: {
submit(){
const data =new FormData()
data.append('course_title', this.form.course_title || '')
data.append('about', this.form.about|| '')
this.$inertia.post(this.route('createcourse'),data)
}
}
}
this is my script:
` import AppLayout from '@/Layouts/AppLayout' //import Welcome from '@/Jetstream/Welcome'
export default {
components: {
AppLayout,
},
data(){
return{
reactive:true,
form:{
course_title: null,
about:null
}
}
},
method: {
submit(){
const data =new FormData()
data.append('course_title', this.form.course_title || '')
data.append('about', this.form.about|| '')
this.$inertia.post(this.route('createcourse'),data)
}
}
}
`