Answer the question
In order to leave comments, you need to log in
How to access data fields in Vue from an async method?
There is a code:
export default {
data() {
return {
nameCity: '',
}
},
methods: {
findCity(event){
event.preventDefault()
findCityCust().then(function(response) {
console.log(response)
this.nameCity = response;
})
},
},
}
Answer the question
In order to leave comments, you need to log in
export default {
data() {
return {
nameCity: '',
}
},
methods: {
findCity(event){
event.preventDefault()
findCityCust().then((response) => {
console.log(response)
this.nameCity = response;
})
},
},
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question