You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
当前 XMarkdown 在流式输出时无法动态展示尾缀(如"正在生成..."或品牌 Logo),导致用户需要在流结束后手动拼接。这影响了用户体验,特别是在 AI 对话、日志滚动等场景中。
Target
支持在Markdown尾部插入ReactNode,可用来展示:
加载动画
版权签名
参考链接
Detailed Design
API 设计
在 XMarkdownProps 中新增 footer 参数:
interfaceXMarkdownProps{/** * @description 文档末尾的 React 节点 * @description React node displayed at the end of document during streaming */footer?: React.ReactNode;/** * @description 文档末尾的 React 节点的 CSS 类名 * @description CSS class name for the footer React node */footerClassName?: string;/** * @description 文档末尾的 React 节点的内联样式 * @description Inline styles for the footer React node */footerStyle?: React.CSSProperties}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
支持在XMarkdown末尾显示自定义内容,适用于添加加载状态、版权签名、引用信息等。#1284
Motivation
当前 XMarkdown 在流式输出时无法动态展示尾缀(如"正在生成..."或品牌 Logo),导致用户需要在流结束后手动拼接。这影响了用户体验,特别是在 AI 对话、日志滚动等场景中。
Target
支持在Markdown尾部插入ReactNode,可用来展示:
Detailed Design
API 设计
在
XMarkdownProps中新增footer参数:行为设计
footerClassName或者footerStyle自定义样式实现方案
使用相对定位的容器包裹 Markdown 内容,footer 使用绝对定位固定在底部:
特点:
样式处理
提供基础样式确保 footer 定位正确:
性能优化
Checklist
<XMarkdown footer={<Spin />} ... />Test Case
Compatibility
0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions