|
@@ -97,8 +97,8 @@
|
|
<!-- ------------分页--------------->
|
|
<!-- ------------分页--------------->
|
|
<div class="pagination">
|
|
<div class="pagination">
|
|
<el-pagination
|
|
<el-pagination
|
|
- v-model:currentPage="currentPage1"
|
|
|
|
- :page-size="10"
|
|
|
|
|
|
+ v-model:currentPage="currentPage"
|
|
|
|
+ v-model:page-size="pageSize"
|
|
background
|
|
background
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
:total="data.length"
|
|
:total="data.length"
|
|
@@ -131,20 +131,23 @@ let props = defineProps({
|
|
},
|
|
},
|
|
})
|
|
})
|
|
|
|
|
|
-const currentPage1 = ref(1)
|
|
|
|
|
|
+const currentPage = ref(1)
|
|
|
|
+const pageSize = ref(10)
|
|
// 收缩展开
|
|
// 收缩展开
|
|
const isExpand = ref(false)
|
|
const isExpand = ref(false)
|
|
const handleSizeChange = (val: number) => {
|
|
const handleSizeChange = (val: number) => {
|
|
console.log(`${val} items per page`)
|
|
console.log(`${val} items per page`)
|
|
|
|
+ pageSize.value = val
|
|
|
|
+ currentPage.value = 1
|
|
}
|
|
}
|
|
const handleCurrentChange = (val: number) => {
|
|
const handleCurrentChange = (val: number) => {
|
|
console.log(`current page: ${val}`)
|
|
console.log(`current page: ${val}`)
|
|
- currentPage1.value = val
|
|
|
|
|
|
+ currentPage.value = val
|
|
}
|
|
}
|
|
|
|
|
|
const list = computed(() => {
|
|
const list = computed(() => {
|
|
let arr = JSON.parse(JSON.stringify(props.data))
|
|
let arr = JSON.parse(JSON.stringify(props.data))
|
|
- return arr.splice((currentPage1.value - 1) * 10, 10)
|
|
|
|
|
|
+ return arr.splice((currentPage.value - 1) * pageSize.value, pageSize.value)
|
|
})
|
|
})
|
|
|
|
|
|
const listLoading = ref(false)
|
|
const listLoading = ref(false)
|