前端面试秘籍:​​https://github.com/yisainan/web-interview​​  欢迎star


直接上代码html:

<Button style="display:inline-block;position: relative;bottom: 13px;" @click.native="changePage(1)">首页</Button>

<Page style="display:inline-block" :current="currentPage" :total="total" :page-size="10" @on-change="changePage" class="page"/>

<Button style="display:inline-block;position: relative;bottom: 13px;" @click.native="changePage(Math.ceil(total/10))">尾页</Button>


js:


changePage (val) {

let _this = this

_this.currentPage = val

this.getDetail(_this.articleType, val, 10)

}