Badge: fix deconstructing props invalidates the data response bug (#1337)

This commit is contained in:
yinfoyuan
2021-01-23 23:12:28 +08:00
committed by GitHub
parent 29298d5974
commit 9bcf2673e7

View File

@@ -59,11 +59,10 @@ export default defineComponent({
if (props.isDot) {
return
}
const { value, max } = props
if (typeof value === 'number' && typeof max === 'number') {
return max < value ? `${max}+` : value
if (typeof props.value === 'number' && typeof props.max === 'number') {
return props.max < props.value ? `${props.max}+` : props.value
}
return value
return props.value
})
return {
content,