fix(components): [pagination] delete input value display empty string (#12134)

This commit is contained in:
btea 2023-03-25 18:18:35 +08:00 committed by GitHub
parent d85ed0f6fa
commit 128fe7026a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,16 +35,16 @@ defineProps(paginationJumperProps)
const { t } = useLocale()
const ns = useNamespace('pagination')
const { pageCount, disabled, currentPage, changeEvent } = usePagination()
const userInput = ref<number>()
const userInput = ref<number | string>()
const innerValue = computed(() => userInput.value ?? currentPage?.value)
function handleInput(val: number | string) {
userInput.value = +val
userInput.value = val ? +val : ''
}
function handleChange(val: number | string) {
val = Math.trunc(+val)
changeEvent?.(+val)
changeEvent?.(val)
userInput.value = undefined
}
</script>