[Vuejs]-Fetched response data is not being stored in component's data property

0👍

this inside the response callback is likely not your component.

Try:

getAccountTypes: function() {
  var component = this;
  this.$http.get('/list/accounttypes').then(response => {
      component.typesofaccount = response.body
    });
},

0👍

Had to import

<script src="https://unpkg.com/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.3.4"></script>

in the child blade template not in the main layout.

Leave a comment