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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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.
- Confirm Vue 3 and not Nuxt. Install only requested peers and import
markstream-vue/index.cssafter resets. - Start with
content. Usemode="chat"for AI streams,docsfor rich documents, andminimalfor lightweight non-chat surfaces. - Choose fenced-code rendering explicitly:
prewithout a peer,shikiwithstream-markdown, or compatibility-namedmonacobacked bystream-diffs. - For live chat use smooth streaming
auto, no fade, and an optional cursor. On completion keep the same mode, setfinal, and disable pacing/cursor. - Use
nodesonly for worker parsing or structural AST ownership. - For long transcripts, keep an existing outer message virtualizer in charge. Use Markstream logical height rather than mounted DOM height.
- Use scoped component registration and preserve safe HTML and Mermaid strict mode.
- 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.
热度
- GitHub 星标
- 48k
- 排名
- #5174
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。