<ul class="pagination">
<li v-for="index in 6" :key="index" @click="pagesClick(index)":class="{ paginaActive: paginaActive === index }"></li>
</ul>
let paginaActive = ref(1);
function pagesClick(index) {
paginaActive.value = index;
}
/* 分页器 */
.pagination {
width: 100%;
text-align: center;
height: 30px;
margin: 20px 0;
}
.pagination>li {
display: inline-block;
margin-right: 6px;
width: 6px;
height: 6px;
border-radius: 3px;
background-color: #4991fc;
}
.paginaActive {
width: 22px !important;
height: 6px;
border-radius: 3px;
background-color: #4991fc;
}