File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div :class =" { 'hidden': hidden }" class =" pagination-container" >
2
+ <div :class =" { hidden }" class =" pagination-container" >
3
3
<el-pagination
4
4
:background =" background"
5
5
v-model:current-page =" currentPage"
18
18
// TODO 芋艿:ts 重写
19
19
// TODO 芋艿:scrollTo 接入
20
20
// import { scrollTo } from '@/utils/scroll-to'
21
+ import { computed } from ' vue'
21
22
22
23
const props = defineProps ({
23
24
total: {
@@ -38,7 +39,7 @@ const props = defineProps({
38
39
return [10 , 20 , 30 , 50 ]
39
40
}
40
41
},
41
- // 移动端页码按钮的数量端默认值5
42
+ // 移动端页码按钮的数量端默认值 5
42
43
pagerCount: {
43
44
type: Number ,
44
45
default: document .body .clientWidth < 992 ? 5 : 7
@@ -61,7 +62,7 @@ const props = defineProps({
61
62
}
62
63
})
63
64
64
- const emit = defineEmits ();
65
+ const emit = defineEmits ([ ' update:page ' , ' update:limit ' , ' pagination ' , ' pagination ' ])
65
66
const currentPage = computed ({
66
67
get () {
67
68
return props .page
@@ -74,7 +75,7 @@ const pageSize = computed({
74
75
get () {
75
76
return props .limit
76
77
},
77
- set (val ){
78
+ set (val ) {
78
79
emit (' update:limit' , val)
79
80
}
80
81
})
@@ -93,7 +94,6 @@ function handleCurrentChange(val) {
93
94
// scrollTo(0, 800)
94
95
}
95
96
}
96
-
97
97
</script >
98
98
99
99
<style scoped>
Original file line number Diff line number Diff line change 103
103
</template >
104
104
</el-table-column >
105
105
</el-table >
106
+ <Pagination
107
+ v-show =" total > 0"
108
+ :total =" total"
109
+ v-model:page =" queryParams.pageNo"
110
+ v-model:limit =" queryParams.pageSize"
111
+ @pagination =" getList"
112
+ />
106
113
</content-wrap >
107
114
108
115
<!-- 表单弹窗:添加/修改 -->
@@ -137,7 +144,7 @@ const getList = async () => {
137
144
try {
138
145
const data = await ConfigApi .getConfigPage (queryParams )
139
146
list .value = data .list
140
- total .value = data .value
147
+ total .value = data .total
141
148
} finally {
142
149
loading .value = false
143
150
}
You can’t perform that action at this time.
0 commit comments