[Vuejs]-How I can retrieve json in vuejs

0👍

Have you tried logging the response? Just use a console.log(result).
About your doubt, you probably have to do this.$set('comments', result.data');.

Don’t forget the semicolon!

0👍

Have a look at the vue-resource package
https://github.com/vuejs/vue-resource

It should work like this

methods: {
  getMessages: function() {
    this.$http({
      url: '/cms/Getweb_manager', 
      method: 'GET'
    }).then(function (response) {
      // success callback
      this.$set('comments', response.result);
    }, function (response) {
      // error callback
    });
  }
}
👤zippex

Leave a comment