fix(components): [table] maxHeight shark (#12349)

This commit is contained in:
Xc 2023-05-29 20:16:31 +08:00 committed by GitHub
parent 9ba2ed7013
commit 015ac099cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -309,16 +309,12 @@ function useStyle<T>(
}
if (props.maxHeight) {
if (!Number.isNaN(Number(props.maxHeight))) {
const maxHeight = props.maxHeight
const reachMaxHeight = tableScrollHeight.value >= Number(maxHeight)
if (reachMaxHeight) {
return {
maxHeight: `${
tableScrollHeight.value -
headerScrollHeight.value -
footerScrollHeight.value
}px`,
}
return {
maxHeight: `${
props.maxHeight -
headerScrollHeight.value -
footerScrollHeight.value
}px`,
}
} else {
return {