Ai
4 Star 4 Fork 5

WeiboGe2012/自动化测试平台vue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Pagination.vue 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
WeiboGe2012 提交于 2020-09-21 09:15 +08:00 . 自动化测试平台页面
/**
* 分页组件
*/
<template>
<el-pagination
class="page-box"
background
:current-page="childMsg.currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="childMsg.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="childMsg.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</template>
<script>
export default {
name: 'Pagination',
// eslint-disable-next-line vue/require-prop-types
props: ['childMsg'],
data () {
return {
pageparm: {
currentPage: this.childMsg.currentPage,
pageSize: this.childMsg.pageSize
}
}
},
created () {},
methods: {
handleSizeChange (val) {
/**
* 子传父
* 参数1 父元素方法
* 参数2 数据
*/
this.pageparm.pageSize = val
this.$emit('callFather', this.pageparm)
},
handleCurrentChange (val) {
/**
* 子传父
* 参数1 父元素方法
* 参数2 数据
*/
this.pageparm.currentPage = val
this.$emit('callFather', this.pageparm)
}
}
}
</script>
<style>
.page-box {
margin: 10px auto;
}
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/WeiboGe2012/automated-test-platform-vue.git
git@gitee.com:WeiboGe2012/automated-test-platform-vue.git
WeiboGe2012
automated-test-platform-vue
自动化测试平台vue
master

搜索帮助