mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-11 22:09:47 +08:00
fix(ui): 追加 vue2 和 react 的修改
This commit is contained in:
parent
695efc00a8
commit
45be838f20
@ -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>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user