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); const [displayText] = useState(config.text);
return ( 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} {displayText}
</p> </div>
); );
}; };

View File

@ -54,9 +54,9 @@ export default defineComponent({
render() { render() {
const className = this.config?.multiple ? 'magic-ui-text' : 'magic-ui-text magic-ui-text--single-line'; const className = this.config?.multiple ? 'magic-ui-text' : 'magic-ui-text magic-ui-text--single-line';
if (typeof this.$slots?.default === 'function') { 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, class: className,
domProps: { domProps: {
innerHTML: this.displayText, innerHTML: this.displayText,