mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-05 04:37:47 +08:00
fix(components): [pagination] delete input value display empty string (#12134)
This commit is contained in:
parent
d85ed0f6fa
commit
128fe7026a
@ -35,16 +35,16 @@ defineProps(paginationJumperProps)
|
|||||||
const { t } = useLocale()
|
const { t } = useLocale()
|
||||||
const ns = useNamespace('pagination')
|
const ns = useNamespace('pagination')
|
||||||
const { pageCount, disabled, currentPage, changeEvent } = usePagination()
|
const { pageCount, disabled, currentPage, changeEvent } = usePagination()
|
||||||
const userInput = ref<number>()
|
const userInput = ref<number | string>()
|
||||||
const innerValue = computed(() => userInput.value ?? currentPage?.value)
|
const innerValue = computed(() => userInput.value ?? currentPage?.value)
|
||||||
|
|
||||||
function handleInput(val: number | string) {
|
function handleInput(val: number | string) {
|
||||||
userInput.value = +val
|
userInput.value = val ? +val : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleChange(val: number | string) {
|
function handleChange(val: number | string) {
|
||||||
val = Math.trunc(+val)
|
val = Math.trunc(+val)
|
||||||
changeEvent?.(+val)
|
changeEvent?.(val)
|
||||||
userInput.value = undefined
|
userInput.value = undefined
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user