Answer the question
In order to leave comments, you need to log in
Vue.js data fails to load?
methods: {
async edit(id) {
this.isEdit = 1;
await axios
.get(
process.env.VUE_APP_API +
"/" +
this.api +
"/" +
this.module +
"/" +
this.submodule +
"/retrieve/?id=" +
id
)
.then((response) => {
let data2=response.data[0];
this.form.title = data2[2];
})
.catch((error) => {
error;
});
},
},
mounted() {
setTimeout(() => {
this.edit(this.$route.params.id);
}, 1000);
},
Answer the question
In order to leave comments, you need to log in
It is logical that the form is initially empty, because data arrives asynchronously. Check in the template if the data has arrived, for example, via v-if
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question