This is my code
var data = {page: page};
this.$http.get('api/products', data ).then(
function (response) {
//look into the routes file and format your response
this.$set('items', response.data.data.data);
this.$set('pagination', response.data.pagination);
}, function (error) {
// handle error
});
I got this from this example https://github.com/JellyBool/laravel-vue-pagination/blob/master/resources/views/welcome.blade.php#L94
But I cant use GET, it doesn't send the parameters. Only clean url (/api/products)
What am I doing wrong?
with 0.9 you need to use params attribute:
this.$http.get('api/products', {params: {page: page}} ).then(
function (response) {
//look into the routes file and format your response
this.$set('items', response.data.data.data);
this.$set('pagination', response.data.pagination);
}, function (error) {
// handle error
});
You saved my day :)
Oh my God !
No clear document about this?
@wonderbeyond it is here: https://github.com/pagekit/vue-resource/blob/master/docs/http.md
thanks man!!!
In case of GET this solution is working but not in case of POST, any suggestions?
Perfect was looking for this answer for a month now.
My day is saved!! Thank you so much!
@webreinvent for POST you just need {someKey: 'someValue'}
Most helpful comment
with 0.9 you need to use params attribute: