lokyoung / vuejs-paginate

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

active-class in anchor tag #73

Closed william-jay closed 6 years ago

william-jay commented 6 years ago

how to put active class in anchor tag? the default active-class is put in the li tag I want to be like this

<ul class="pagination"> <li><a class="pagination-link is-current"> 1 </a> </li> <li><a class="pagination-link"> 2 </a> </li> <li><a class="pagination-link"> 3 </a> </li> </ul>

william-jay commented 6 years ago

any help?

MirkoManojlovic commented 6 years ago

I had the same issue and I found that if you put no-li-surround prop to true, active class will be set on anchor tag instead of list tag.

Code:

<template>
    <paginate
        :page-count="20"
        :page-range="3"
        :margin-pages="2"
        :click-handler="clickCallback"
        :prev-text="'Prev'"
        :next-text="'Next'"
        :container-class="'pagination'"
        :page-class="'page-item'"
        :no-li-surround="true">
    </paginate>
</template>

Hope this helps you :)

Cheers

lokyoung commented 6 years ago

@william-jay You can try no-li-surround. Hope it helps you. @MirkoManojlovic Thanks.