From b4e1a7253c9b9cfedf01375ab00b4f9f8965f690 Mon Sep 17 00:00:00 2001 From: Folee <597171538@qq.com> Date: Wed, 18 Aug 2021 11:21:06 +0800 Subject: [PATCH] fix(pagination): Fix that current-page and page-size do not support hyphen style when using v-model (#2884) * fix(pagination): Fix that current-page and page-size do not support hyphen style when using v-model * fix(pagination): Fix the bug that the value of hasCurrentPageListener is always true --- packages/pagination/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pagination/src/index.ts b/packages/pagination/src/index.ts index 870a2a0918..0bd94a3a4d 100644 --- a/packages/pagination/src/index.ts +++ b/packages/pagination/src/index.ts @@ -122,8 +122,8 @@ export default defineComponent({ const { t } = useLocaleInject() const vnodeProps = getCurrentInstance().vnode.props || {} // we can find @xxx="xxx" props on `vnodeProps` to check if user bind corresponding events - const hasCurrentPageListener = 'onUpdate:currentPage' in vnodeProps || 'onCurrentChange' in vnodeProps - const hasPageSizeListener = 'onUpdate:pageSize' in vnodeProps || 'onSizeChange' in vnodeProps + const hasCurrentPageListener = 'onUpdate:currentPage' in vnodeProps || 'onUpdate:current-page' in vnodeProps || 'onCurrentChange' in vnodeProps + const hasPageSizeListener = 'onUpdate:pageSize' in vnodeProps || 'onUpdate:page-size' in vnodeProps || 'onSizeChange' in vnodeProps const assertValidUsage = computed(() => { // Users have to set either one, otherwise count of pages cannot be determined if (isAbsent(props.total) && isAbsent(props.pageCount)) return false