Skip to content
当前页

UI 组件使用问题记录

纯前端表格分页

vue
<template>
	<el-table :data="tableData.slice((page.currentPage - 1) * page.pagesize, page.currentPage * page.pagesize)"> </el-table>
</template>

<script>
export default {
	data() {
		return {
			page: {
				currentPage: 1,
				pagesize: 10,
				total: 0,
			},
		}
	},
	methods: {
		handleCurrentChange(val) {
			this.page.currentPage = val
		},
	},
}
</script>