fix(ui): 追加 vue2 和 react 的修改

This commit is contained in:
i33 2022-09-14 14:50:10 +08:00 committed by jia000
parent 695efc00a8
commit 45be838f20
2 changed files with 4 additions and 4 deletions

View File

@ -34,9 +34,9 @@ const Text: React.FC<TextProps> = ({ config }) => {
const [displayText] = useState(config.text);
return (
<p ref={ref} className="magic-ui-text" style={app.transformStyle(config.style || {})} id={`${config.id || ''}`}>
<div ref={ref} className="magic-ui-text" style={app.transformStyle(config.style || {})} id={`${config.id || ''}`}>
{displayText}
</p>
</div>
);
};

View File

@ -54,9 +54,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,
domProps: {
innerHTML: this.displayText,