JellyBool / laravel-vue-pagination

Pagination with Vue and Laravel
148 stars 24 forks source link

Make pagination controls a reusable component #4

Open carcinocron opened 8 years ago

carcinocron commented 8 years ago

This should be a reusable sub-component of <div id="app">

            <nav>
                <ul class="pagination">
                    <li v-if="pagination.current_page > 1">
                        <a href="#" aria-label="Previous"
                           @click.prevent="changePage(pagination.current_page - 1)">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li v-for="page in pagesNumber"
                        v-bind:class="[ page == isActived ? 'active' : '']">
                        <a href="#"
                           @click.prevent="changePage(page)">@{{ page }}</a>
                    </li>
                    <li v-if="pagination.current_page < pagination.last_page">
                        <a href="#" aria-label="Next"
                           @click.prevent="changePage(pagination.current_page + 1)">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
JellyBool commented 8 years ago

Good idea ! Just submit a pr if you don't mind @InstanceOfMichael