pagination.vue 774 Bytes

<template>
	<div class="comp">
		<div class="pagination">
			<span class="pointer" :class="{'disabled' : cur == 1}">
				<a @click="prevPage()">上一页</a>
			</span>
			<span @click="selPage(index)" class="page-num pointer" v-for="(index,idx) in indexs" :key="idx" v-bind:class="{ 'active': cur == index}">
				<a>{{index}}</a>
			</span>
			<span class="pointer" :class="{'disabled' : cur == total}">
				<a @click="nextPage()">下一页</a>
			</span>
			<span></span>
			<input v-model="sel" class="ipt" :placeholder="cur" type="text">
			<span>/ {{total}}</span>
			<span @click="jumpPage" class="jump pointer">跳转</span>
		</div>
	</div>
</template>

<script src="./pagination.js"></script>
<style lang="scss" scoped>
@import "./pagination.scss";
</style>