How to use Driver in a vue.js?

0

I found this comment related to the use of vue.js but in reality I could not make it go

in my case I have the vue component related to the view

This is my User.Controller driver

in the view "users.blade" command call my component ""

and here "suariocomponent.vue"

and this error marks me

    
asked by yamile ibarra 01.10.2018 в 17:33
source

1 answer

0

I found the answer and for this it is enough to call axios

let data1 =axios.get("api/user").then((response)=>{ this.users = response.data.users});

where "axios.get" is the method to use ("api/user") is the path of the controller, preferably it has to be in "API" and then((response)=>{ this.users= response.data.users}); is the answer and where you want it to be stored, in my case the answer it is saved in "users",

unlike what I put above the declaration of variables, in this case it will have to be as follows:

data(){
        return {
           users: [],
      }
    },
    
answered by 08.10.2018 / 19:31
source