markstream-vue2-vite
它能做什么
这个工具可以帮你在使用 Vite 的 Vue 2 项目中用上 “markstream-vue2” 组件。它能确保一切正常工作,包括图表(Mermaid)和数学公式(KaTeX)等特殊功能。
适用场景
- ✓当你的项目使用 Vue 2 和 Vite 时。
- ✓如果你需要让图表(Mermaid)或公式(KaTeX)在 Vue 2 项目中正常显示时。
- ✓想安全、高效地集成 “markstream-vue2” 组件时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-vue2-vite/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我要怎样在使用 Vite 的 Vue 2 项目中设置 markstream-vue2,以显示图表?”
每周 5 个新技能,1 分钟读完。
工作原理
它会配置你的项目,让 Vite 能够打包并使用 markstream-vue2 的特殊功能,比如图表相关的功能。它还会调整文本的显示方式,让显示更安全、更快。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Markstream Vue 2 Vite
Overview
Use Vite-native worker bundling while preserving Vue 2 compatibility and rendering safety.
When to Use
Use when the host is Vue 2 with Vite and needs bundled Mermaid or KaTeX workers. Use the generic Vue 2 skill when worker/bundler behavior is irrelevant.
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 2 with Vite and install only requested peers.
- Import
markstream-vue2/index.cssafter reset, Tailwind, or UnoCSS layers. - Use package worker entrypoints with Vite
?workeror?worker&inlineimports only when needed. - Add
@vue/composition-apionly for Vue 2.6 code requiring it. - Keep
contentwith smooth streaming for chat; setfinaland disable pacing/cursor for history. - Use
nodesonly for externally owned parsing. Keep HTML safe and Mermaid strict. - Validate the Vite build and worker loading path.
Example
<script>
import MarkdownRender from 'markstream-vue2'
import 'markstream-vue2/index.css'
export default {
components: { MarkdownRender },
props: { content: String, done: Boolean },
}
</script>
<template>
<MarkdownRender
:content="content"
:final="done"
:fade="done"
/>
</template>
Limitations
- Vite worker syntax is not portable to Vue CLI/Webpack 4.
- Inline workers can increase bundle size.
- Optional peers may impose additional browser requirements.
Security & Safety Notes
Review worker source, CSP, dependency changes, and bundle impact. Do not relax safe rendering defaults.
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.
Vue 2 is end-of-life; preserve a requested legacy integration and document its maintenance/support decision rather than silently upgrading the whole application. Prefer reviewed locally bundled workers over mutable CDN code where feasible.
常见问题
什么是 Vite?
Vite 是一款现代的网页项目构建工具,以速度快著称。
什么是 Vue 2?
Vue 2 是一款流行的网页界面框架的较早版本。它虽然比较老,但仍有很多项目在使用。
什么是“workers”?
workers 就像一些在后台运行的小程序,负责执行任务,这样就不会让网站的主界面卡住。
详情
作者的原始描述
Integrate markstream-vue2 into Vue 2 plus Vite with bundled worker imports, CSS ordering, Composition API compatibility, and safe streaming defaults.
热度
- GitHub 星标
- 48k
- 排名
- #5176
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。