重构:在 config 列表,引入分页组件
This commit is contained in:
parent
ba563f76c6
commit
0506c4e54d
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div :class="{ 'hidden': hidden }" class="pagination-container">
|
||||
<div :class="{ hidden }" class="pagination-container">
|
||||
<el-pagination
|
||||
:background="background"
|
||||
v-model:current-page="currentPage"
|
||||
@ -18,6 +18,7 @@
|
||||
// TODO 芋艿:ts 重写
|
||||
// TODO 芋艿:scrollTo 接入
|
||||
// import { scrollTo } from '@/utils/scroll-to'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
total: {
|
||||
@ -61,7 +62,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits();
|
||||
const emit = defineEmits(['update:page', 'update:limit', 'pagination', 'pagination'])
|
||||
const currentPage = computed({
|
||||
get() {
|
||||
return props.page
|
||||
@ -93,7 +94,6 @@ function handleCurrentChange(val) {
|
||||
// scrollTo(0, 800)
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
@ -103,6 +103,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</content-wrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
@ -137,7 +144,7 @@ const getList = async () => {
|
||||
try {
|
||||
const data = await ConfigApi.getConfigPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.value
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user