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
This commit is contained in:
Folee
2021-08-18 11:21:06 +08:00
committed by GitHub
parent c5c816c094
commit b4e1a7253c

View File

@@ -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