Skip to content
Discussion options

You must be logged in to vote

补充说明:如果你的目标只是使用 playground 里展示的 stream-diffs 增强代码块,最简单的做法是直接去掉 mode="chat"。docs 模式默认会使用增强的 stream-diffs surface:

<MarkdownRender
  :content="content"
  :final="!isStreaming"
  :smooth-streaming="isStreaming ? 'auto' : false"
  :fade="!isStreaming"
  :typewriter="isStreaming"
  :max-live-nodes="isStreaming ? 0 : undefined"
  html-policy="safe"
  code-block-stream
  :render-code-blocks-as-pre="false"
/>

只有在确实需要 chat 模式的默认渲染策略时,才保留 mode="chat",并显式加上 code-renderer="monaco"。这里的 monaco 是历史兼容名称,实际使用的是已安装的 stream-diffs runtime,不是 Monaco Editor。

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@seepine
Comment options

Answer selected by seepine
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@seepine
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants