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

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

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

可以这样问 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.

  1. Confirm Vue 2 with Vite and install only requested peers.
  2. Import markstream-vue2/index.css after reset, Tailwind, or UnoCSS layers.
  3. Use package worker entrypoints with Vite ?worker or ?worker&inline imports only when needed.
  4. Add @vue/composition-api only for Vue 2.6 code requiring it.
  5. Keep content with smooth streaming for chat; set final and disable pacing/cursor for history.
  6. Use nodes only for externally owned parsing. Keep HTML safe and Mermaid strict.
  7. 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.

repo: sickn33/agentic-awesome-skills

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能