【发布时间】:2021-07-14 08:03:32
【问题描述】:
在 vue 中我处理代码:
<b-pagination
:total-rows="props.total"
first-number
last-number
align="right"
prev-class="prev-item"
next-class="next-item"
class="mt-1 mb-0"
@input="changePage"
>
</b-pagination>
这是一个分页示例:
>
methods: {
changePage() {
//get current page
}
}
现在我想在方法中获取当前页面,请给我一些想法,谢谢。
【问题讨论】:
-
您的页面是否基于路由器路径?
computed: {currentPage(){return this.$router.query.page;}}可以工作 -
网址页面
http://localhost.loca/product -
能否请您显示此组件的更多代码?尤其是代码从 api 获取数据
标签: javascript vue.js vuejs2