<!DOCTYPE htmlhtmlheadmeta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
charset="utf-8"title="keywords"="" ="description"script type="text/javascript" src="js/vue.min.js"scriptstyle>
.page-bar{
margin:40px;
} 0px;
padding
li
list-style none
.page-bar li:first-child>a
margin-left 0px
.page-bar a
border 1px solid #ddd
text-decoration none
position relative
float left 6px 12px
margin-left -1px
line-height 1.42857143
color #337ab7
cursor pointer
.page-bar a:hover
background-color #eee
.page-bar a.banclicknot-allowed
.page-bar .active a #fff default
border-color
.page-bar i
font-stylenormal #d44950 0px 4px
font-size 12px}
body>
="text/javascript">
var pageBar = new Vue({
el: '.page-bar8//总页数
cur: 1当前页码
},watch: {
cur: function(data){页码点击事件
if(data != this.cur){
.cur =(){
console.log(现在在+.cur页(){
left ;
right .all;
ar [];
(.all>= 5){
> 3 && < -2){
left -
right +
}else{
<=3
}{
right .all
left .all 4
}
}
}
while (left right){
ar.push(left)
left ++
}
return ar
}
}
})
>