Level 63
What do you have in the console with this ?
save(){
console.log(this.editMode);
axios.post('/create', this.form).then(response => {
this.editMode = true
console.log(this.editMode);
})
console.log(this.editMode);
}
I'm not sure if this is an ok way to do inertia, but the issue I'm having is that I'm trying to get editMode to be true after posting a form but it is still saying false.
<script>
import AppLayout from '../../Layouts/AppLayout.vue';
import {useForm} from "@inertiajs/vue3";
import InputLabel from "../../../../vendor/laravel/jetstream/stubs/inertia/resources/js/Components/InputLabel.vue";
import TextInput from "../../../../vendor/laravel/jetstream/stubs/inertia/resources/js/Components/TextInput.vue";
export default {
components: {
AppLayout,
useForm,
InputLabel,
TextInput
},
props: [],
data(){
return {
editMode: false,
form: {
name: null,
description: null,
}
}
},
methods: {
save(){
axios.post('/create', this.form).then(response => {
this.editMode = true
})
}
}
}
</script>
Please or to participate in this conversation.