fix(components): [button] space is not added (#6361)

This commit is contained in:
Alan Wang
2022-03-02 12:17:03 +08:00
committed by GitHub
parent 69de57b8d4
commit e95dedd22b
2 changed files with 17 additions and 2 deletions

View File

@@ -77,8 +77,8 @@ const shouldAddSpace = computed(() => {
if (autoInsertSpace.value && defaultSlot?.length === 1) {
const slot = defaultSlot[0]
if (slot?.type === Text) {
const text = slot.children
return /^\p{Unified_Ideograph}{2}$/u.test(text as string)
const text = slot.children as string
return /^\p{Unified_Ideograph}{2}$/u.test(text.trim())
}
}
return false