|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div :class="{ 'hidden': hidden }" class="pagination-container">
|
|
|
|
|
|
+ <div :class="{ hidden }" class="pagination-container">
|
|
<el-pagination
|
|
<el-pagination
|
|
:background="background"
|
|
:background="background"
|
|
v-model:current-page="currentPage"
|
|
v-model:current-page="currentPage"
|
|
@@ -18,6 +18,7 @@
|
|
// TODO 芋艿:ts 重写
|
|
// TODO 芋艿:ts 重写
|
|
// TODO 芋艿:scrollTo 接入
|
|
// TODO 芋艿:scrollTo 接入
|
|
// import { scrollTo } from '@/utils/scroll-to'
|
|
// import { scrollTo } from '@/utils/scroll-to'
|
|
|
|
+import { computed } from 'vue'
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
total: {
|
|
total: {
|
|
@@ -38,7 +39,7 @@ const props = defineProps({
|
|
return [10, 20, 30, 50]
|
|
return [10, 20, 30, 50]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 移动端页码按钮的数量端默认值5
|
|
|
|
|
|
+ // 移动端页码按钮的数量端默认值 5
|
|
pagerCount: {
|
|
pagerCount: {
|
|
type: Number,
|
|
type: Number,
|
|
default: document.body.clientWidth < 992 ? 5 : 7
|
|
default: document.body.clientWidth < 992 ? 5 : 7
|
|
@@ -61,7 +62,7 @@ const props = defineProps({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
-const emit = defineEmits();
|
|
|
|
|
|
+const emit = defineEmits(['update:page', 'update:limit', 'pagination', 'pagination'])
|
|
const currentPage = computed({
|
|
const currentPage = computed({
|
|
get() {
|
|
get() {
|
|
return props.page
|
|
return props.page
|
|
@@ -74,7 +75,7 @@ const pageSize = computed({
|
|
get() {
|
|
get() {
|
|
return props.limit
|
|
return props.limit
|
|
},
|
|
},
|
|
- set(val){
|
|
|
|
|
|
+ set(val) {
|
|
emit('update:limit', val)
|
|
emit('update:limit', val)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -93,7 +94,6 @@ function handleCurrentChange(val) {
|
|
// scrollTo(0, 800)
|
|
// scrollTo(0, 800)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|