vuejs

Basic Axios http get request in Vuejs

searchProduct(){
                    this.results=[];
                    console.log('System is looking for ..');
                    axios.post('/api/searchitem',{
                        query : this.search,
                    }).then((response)=>{
                        // console.log(response);
                        this.results = response.data;
                    }).catch((error)=>{
                        console.log(error);
                    });
                },

This code makes an external get Api call to the laravel Backend api for a seach bar. 

Was this helpful?