mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +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;
|
||||
|
||||
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}
|
||||
</div>
|
||||
</p>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -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('div', { class: className }, [this.$slots?.default?.() || '']);
|
||||
return h('p', { class: className }, [this.$slots?.default?.() || '']);
|
||||
}
|
||||
return h('div', {
|
||||
return h('p', {
|
||||
class: className,
|
||||
domProps: {
|
||||
innerHTML: this.displayText,
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<span>{{ config.text }}</span>
|
||||
<p>{{ config.text }}</p>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user