<template>
<el-pagination @size-change=\"handleSizeChange\" @current-change=\"handleCurrentChange\" :page-sizes=\"[10, 20, 30, 40]\" :page-size=\"pageSize\" layout=\"total, sizes, prev, pager, next, jumper\" :total=\"total\" style=\"float:right;\">
</el-pagination>
</template>
< type=\"text/ecma -6\">
export default {
components: {
},
data() {
return {
}
},
props: {
pageSize: {
type: Number,
default: 10
},
total: {
type: Number,
default: 1
}
},
watch: {
},
methods: {
//每页展示条数
handleSizeChange(val) {
//事件传递
this.$emit(\'handleSizeChangeSub\', val);
},
//当前页
handleCurrentChange(val) {
//事件传递
this.$emit(\'handleCurrentChangeSub\', val);
}
},
// 过滤器设计目的就是用于简单的文本转换
filters: {},
// 若要实现更复杂的数据变换,你应该使用计算属性
computed: {
},
created() {
},
mounted() {},
destroyed() {}
}
</ >
<style lang=\"scss\" type=\"text/css\" scoped>
</style>
调用
// 分页
import pages from \'components/common/pages/pages\'
components: {
pages
},
<pages :total=\"total\" :page-size=\"pageSize\" @handleSizeChangeSub=\"handleSizeChangeFun\" @handleCurrentChangeSub=\"handleCurrentChangeFun\"></pages>
handleSizeChangeFun(v) {
this.pageSize = v;
this._enterpriseList(); //更新列表
},
handleCurrentChangeFun(v) { //页面点击
this.pageNum = v; //当前页
this._enterpriseList(); //更新列表
}
继续阅读与本文标签相同的文章
下一篇 :
《6大爬虫利器,轻松搞定爬虫》
-
阿里云注册域名教程
2026-05-19栏目: 教程
-
程序员开发工具大全
2026-05-19栏目: 教程
-
开箱即用-OSS无代理备份
2026-05-19栏目: 教程
-
RDS MySQL 8.0 Returning
2026-05-19栏目: 教程
-
阿里云智能大学训练营讲师培训
2026-05-19栏目: 教程
