mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-10 12:39:04 +08:00
feat(ui): text使用p渲染
This commit is contained in:
parent
bdad1a41f9
commit
391fceef30
@ -32,9 +32,9 @@ const Text: React.FC<TextProps> = ({ config }) => {
|
|||||||
if (!app) return null;
|
if (!app) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="magic-ui-text" style={app.transformStyle(config.style || {})} id={`${config.id || ''}`}>
|
<p className="magic-ui-text" style={app.transformStyle(config.style || {})} id={`${config.id || ''}`}>
|
||||||
{config.text}
|
{config.text}
|
||||||
</div>
|
</p>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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('div', { class: className }, [this.$slots?.default?.() || '']);
|
return h('p', { class: className }, [this.$slots?.default?.() || '']);
|
||||||
}
|
}
|
||||||
return h('div', {
|
return h('p', {
|
||||||
class: className,
|
class: className,
|
||||||
domProps: {
|
domProps: {
|
||||||
innerHTML: this.displayText,
|
innerHTML: this.displayText,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<span>{{ config.text }}</span>
|
<p>{{ config.text }}</p>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user