For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt, and this page is available as Markdown at /apps-plugin/docs/components/media/rich-text.md.

rich-text

富文本组件,支持 HTML 字符串或结构化节点,并自动同步内容高度。写法与小程序 rich-text 兼容。

扫码预览

扫码预览 rich-text

Props

属性名类型默认值必填说明
classNamestring-否外层容器的类名。
nodesstring | RichTextNode[]-否要渲染的内容,可传 HTML 字符串或结构化节点数组。
白名单外的节点和属性会先被移除,再交给底层渲染。
spaceRichTextSpace-否文本节点中的普通空格如何转换。
stylestring | CSSProperties-否外层容器的内联样式。