dhaval
368
4
Vue

this.$http.get is not working

Posted 2 years ago by dhaval

I am trying to use Vue js for laravel project. this is first time I am using Vue js.

brand.blade.php

        <brands></brands>

    </div>

    <template id="brand-template">

        <ul>
            @{{ list.count }}
            <li v-for="brand in list.brand"> @{{ brand.brand_id }}  </li>

        </ul>

    </template>

brand.js

Vue.component('brands',{

template: '#brand-template',

data: function(){

    return{

        list: []
    }

},

created: function(){

    this.$http.get('api/brands', function(brand){ // if I use $.getJSON('api/brands', nction(brand){ it's working perfect

        console.log(brand);
      this.list = brand;

    }.bind(this));

}

}); new Vue({ el: '.container' })

can anyone help me?

I have also include Vue js and Vue-resource js

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.