lokyoung / vuejs-paginate

A Vue.js(v2.x+) component for creating pagination.
MIT License
778 stars 171 forks source link

documentation needed #67

Closed nise closed 6 years ago

nise commented 6 years ago

Could you provide an example on how to apply the component to some page items?

I tried the following, but it is not possible to browse through pages of items:


`<paginate
            :page-count="3"
            :page-range="3"
            :margin-pages="2"

            :prev-text="\'Prev\'"
            :next-text="\'Next\'"
            :container-class="\'pagination\'"
            :page-class="\'items\'">

        </paginate>
        <div class="pagination">
        <div class="items">1</div>
            <div class="items">1</div>
            <div class="items">1</div>
            <div class="items">1</div>
            <div class="items">1</div>
            <div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div><div class="items">1</div>
        </div>`

What is wrong with it?

lokyoung commented 6 years ago

Hi @nise . You need to handle the page items yourself. This component is just the pagination part. For your issue, you need to split your page items into multiple parts based on your page-count. And you need to define the click-handler so that the UI will load your page items in that page. You can get any details in the documentation. Thanks.