The following code refers to a component function which fetches data from an url and tries to set that data to a property. It's not working, seems like this is not accessible form the ajax clousure scope.
var MyComp = Vue.extend({
props: {
html_prop: {}
....
},
methods: {
fetchCondiciones: function(url){
$.ajax({
type: "GET",
url: url,
cache: false,
data: vardata ,
success: function(data,status,error) {
if( data!=''){
this.html_prop = data;
}
},
error: function(data,status,error){
alert(error);
}
});
}
...
}
})
How could I make this accessible?