I'm trying to bring data from a Laravel driver to Vue JS.
data() {
return {
article: undefined
}
},
created() {
this.$http.get('article/' + this.$route.params.id + '/edit?include=category,tags')
.then((response) => {
this.article = response.data.data
})
},
The issue is that I do not want to get that data to show it in the view, I want to have that data to interact with them in the same method. More specifically, to make a layer in Leatfet of markers with the latitude and longitude fields of the Articles table.
method(){
getcapas(){
//Código Leatfet
var articles = this.$http.get('article/' + this.$route.params.id + '/edit?include=category,tags')
.then((response) => {
return response.data.data
})
}
//Código Leatfet con los datos de la tabla articles
When I make a console.log of the articles variable, I get the following:
Promise
[[PromiseStatus]]...
[[PromiseValue]]= array(4) /*Con todos los valores que necesito.
How could I get the data from [[PromiseValue]] in the same method?
I've been investigating but I have not found a way to get that data and I have not found anything.