Pagination 分页

 Pagination 分页_第1张图片

	
			

 

const total = ref(0)
const queryForm = ref({
	pageNo: 1,
	pageSize: 10,
	name: '',
	code: '',

})
// 初始化表格数据
const getTableData = async () => {
	try {
		loading.value = true
		const res = await getRoleValue(queryForm.value)
		tableData.value = res.rows
		total.value = res.totalRows
		loading.value = false
	} catch (error) {

	}


// 查询
const onQuery = () => {
	queryForm.value.pageNo = 1;
	getTableData()
}
// 重置
const resetForm = () => {
	resetValue();
	getTableData()
}
// 分页改变
const onHandleSizeChange = (val: number) => {
	queryForm.value.pageSize = val;
	getTableData();
};
// 分页改变
const onHandleCurrentChange = (val: number) => {
	queryForm.value.pageNo = val;
	getTableData();
};

你可能感兴趣的:(vue.js,elementui,javascript)