[Vuejs]-Load a combo with AJAX in VueJS (onLoad)

0👍

The scope of this is not what you think. In your case, this is the jqXHR object of the Ajax call, not the Vue instance.

You should assign this to a support variable:

 getFederations: function() {
   var url = '/api/v1/federationsofcats';
   var myVm = this;
   $.getJSON(url, function (data) {
        console.log(data);
        myVm.federations = data;
   });
 }

Leave a comment