jeudi 2 mai 2019

vuejs Pagination GET Url Params

I am using https://github.com/gilbitron/laravel-vue-pagination pagination it works fine.I have included pagination in the page as below

<pagination :data="posts" @pagination-change-page="getResults"></pagination>

and the method

        getResults(page = 1) {
                    axios.get('api/post?page=' + page)
                        .then(response => {
                            this.posts = response.data;
                        });
            },  

Now when i searchBy Category the pagination links shows api/findByCategoy?page=1

        selectCatgory(e) {
                   axios.get('api/findByCategoy?category=' + e.target.value)
                    .then((data) => {
                        this.posts = data.data
                    })
                    .catch(() => {

                    })
        },

How to include GET param in the pagination urls



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2Y7cqZz
via IFTTT

Aucun commentaire:

Enregistrer un commentaire