From 7f33b3798bc0882b44dd1b5c8d141eb674f8cf13 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 20 Sep 2024 16:58:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E6=95=B0=E5=88=B0?= =?UTF-8?q?=E8=BE=BE=E4=B8=B4=E7=95=8C=E5=80=BC=E6=97=B6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/my-components/my-pagination.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/my-components/my-pagination.vue b/components/my-components/my-pagination.vue index 2b9bab0..74d67eb 100644 --- a/components/my-components/my-pagination.vue +++ b/components/my-components/my-pagination.vue @@ -29,6 +29,7 @@ ref, watch } from 'vue'; + import infoBox from '@/commons/utils/infoBox.js' const props = defineProps({ size: { type: Number, @@ -51,7 +52,7 @@ default: 0 } }) - const emits = defineEmits(['change']) + const emits = defineEmits(['change','update:page']) let currentPage = ref(props.page === 0 ? 1 : props.page) @@ -81,16 +82,17 @@ function btnClick(isAdd) { let newPage = currentPage.value * 1 + (isAdd == 'add' ? 1 : -1) if (newPage <= 0) { - return + return infoBox.showToast('已经是第一页了') } if (newPage > maxPage.value) { - return + return infoBox.showToast('没有更多页了') } setCurrentPage(newPage) } watch(() => currentPage.value, (newval) => { emits('change', newval) + emits('update:page', newval) defaultPaageIndex.value = newval - 1 }) @@ -122,8 +124,8 @@ .prve,.next { &.disabled { - background-color: #ccc; - border-color: #ccc; + // background-color: #ccc; + // border-color: #ccc; } }