跳到正文
Skillpedia
网站与界面(前端)48k · #5174

markstream-vue

它能做什么

这个工具可以帮你在使用 Vue 3 搭建的网站上显示带格式的文本。文本可以像被打字一样逐字出现,还提供了多种显示样式,并针对很长的文本做了优化。

适用场景

  • ✓当你想显示像在聊天窗口里被打出来的文字时。
  • ✓在 Vue 3 网站上显示带有特殊格式的文档时。
  • ✓当你需要显示很长的文本,又不想让网站变慢时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-vue/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-vue/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“把下面这段文字用打字机效果显示在聊天窗口里,并且保证格式安全:”

每周 5 个新技能,1 分钟读完。

工作原理

工具会在你的 Vue 3 代码中插入一个组件,它负责解析文本,并按照设置显示出来。你可以选择文本的出现方式(聊天模式、文档模式等),以及渲染方式(代码、纯文本等)。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Markstream Vue 3

Overview

Configure the Vue 3 renderer beyond generic installation: surface modes, streaming lifecycle, code rendering, long-message virtualization, and scoped overrides.

When to Use

Use for a plain Vue 3 application after the package has been selected. Use markstream-nuxt when SSR-specific Nuxt boundaries matter.

Workflow

Inspect the existing package manager, installed package version and project conventions. A requested scoped integration already authorizes routine source/dependency edits; seek approval only for a material scope expansion or unresolved beta/alpha adoption decision.

  1. Confirm Vue 3 and not Nuxt. Install only requested peers and import markstream-vue/index.css after resets.
  2. Start with content. Use mode="chat" for AI streams, docs for rich documents, and minimal for lightweight non-chat surfaces.
  3. Choose fenced-code rendering explicitly: pre without a peer, shiki with stream-markdown, or compatibility-named monaco backed by stream-diffs.
  4. For live chat use smooth streaming auto, no fade, and an optional cursor. On completion keep the same mode, set final, and disable pacing/cursor.
  5. Use nodes only for worker parsing or structural AST ownership.
  6. For long transcripts, keep an existing outer message virtualizer in charge. Use Markstream logical height rather than mounted DOM height.
  7. Use scoped component registration and preserve safe HTML and Mermaid strict mode.
  8. Validate the smallest build/typecheck plus one incremental stream and one long-message case.

Example

<script setup lang="ts">
import MarkdownRender from 'markstream-vue'
import 'markstream-vue/index.css'

defineProps<{ content: string; isDone: boolean }>()
</script>

<template>
  <MarkdownRender
    mode="chat"
    :content="content"
    :final="isDone"
    :fade="isDone"
    :typewriter="!isDone"
    :smooth-streaming="isDone ? false : 'auto'"
    html-policy="safe"
  />
</template>

Limitations

  • Optional peers add bundle and browser-runtime cost.
  • DOM-minimal mode disables wrapper-dependent features.
  • Virtualization integration requires stable content and measurement keys.

Security & Safety Notes

Review dependency changes. Never enable trusted HTML or loose Mermaid rendering for untrusted model output.

Verify props, export paths and peer ranges against the installed package, not a mutable upstream main. Test partial and completed streams, malformed/untrusted Markdown, links and image URLs, cancellation and reduced motion. Safe HTML and strict diagrams reduce exposure but do not alone enforce URL/network privacy or application component permissions.

常见问题

我需要用 Nuxt,还是只用 Vue 3 就可以?

这个工具适用于普通的 Vue 3。如果你用的是 Nuxt,它也有专门的版本。

怎样让文字出现得更快?

你可以调整 “streaming” 相关的选项,来控制文字显示的速度和流畅程度。

显示任意文本都安全吗?

只要你配置 html-policy="safe" 并开启 Mermaid strict mode(严格模式),就是安全的。对于不可信的内容,一定要先开启这些保护措施再显示。

详情

作者的原始描述

Integrate markstream-vue into plain Vue 3 with renderer modes, code and DOM choices, streaming state, virtualization, optional peers, and scoped components.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5174
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能