fix(ui): 修复text组件在流式容器内无宽高问题

This commit is contained in:
i33 2022-09-14 11:40:39 +08:00 committed by jia000
parent b915accb71
commit 695efc00a8

View File

@ -52,9 +52,9 @@ export default defineComponent({
render() {
const className = this.config?.multiple ? 'magic-ui-text' : 'magic-ui-text magic-ui-text--single-line';
if (typeof this.$slots?.default === 'function') {
return h('span', { class: className }, [this.$slots?.default?.() || '']);
return h('div', { class: className }, [this.$slots?.default?.() || '']);
}
return h('span', {
return h('div', {
class: className,
...(this.displayText ? { innerHTML: this.displayText } : {}),
});