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

markstream-nuxt

它能做什么

这个工具可以帮你在 Nuxt 3 或 4 项目中使用 'markstream-vue'。它能确保只能在浏览器中运行的代码部分被正确执行,即使网站是在服务器上构建的。

适用场景

  • ✓在 Nuxt 3 或 4 中创建页面或组件时。
  • ✓当你想实时显示 AI 生成的内容(流式传输)时。
  • ✓将富文本文档或轻量级界面集成到你的 Nuxt 项目中时。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“我怎样才能在我的 Nuxt 网站上以聊天的形式显示 AI 生成的文本?”

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

工作原理

它通过将需要浏览器才能运行的代码分离出来,来配置 'markstream-vue' 与 Nuxt 协同工作。这是借助 Nuxt 的功能实现的,例如 `<ClientOnly>` 或动态导入。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Markstream Nuxt

Overview

Integrate markstream-vue into Nuxt while keeping hydration, browser-only peers, workers, and streaming behavior on the correct side of SSR boundaries.

When to Use

Use for Nuxt 3 or 4 pages, components, or plugins. Use markstream-vue for non-Nuxt Vue applications and markstream-install when the framework is not yet known.

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 Nuxt 3 or 4 and install only requested peers.
  2. Put browser-only peers behind <ClientOnly>, .client plugins, dynamic imports, or guarded initialization.
  3. Import markstream-vue/index.css explicitly from a client-safe shell or plugin.
  4. Start with content: mode="chat" for AI streams, docs for rich documents, and minimal for lightweight non-chat surfaces.
  5. Keep smooth streaming in auto mode for SSR; do not force true on first-screen server content.
  6. When a chat row completes, keep its mode stable, set final, disable pacing/cursor, and enable fade only if desired.
  7. Keep HTML safe and Mermaid strict. Put optional code, diagram, and worker runtimes behind client boundaries.
  8. Validate build/typecheck, hydration, and one incremental client update.

Example

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

defineProps<{ markdown: string; done: boolean }>()
</script>

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

Limitations

  • Browser-only peers cannot run during SSR.
  • Hydration depends on correct host plugin/component boundaries.
  • This skill does not configure deployment adapters.

Security & Safety Notes

Do not expose trusted HTML or loose Mermaid settings to untrusted model output. Review dependency and runtime-boundary changes.

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.

常见问题

什么是 SSR?

SSR(服务端渲染)指网站在服务器上组装好之后再发送到用户的浏览器。这有助于提升性能和 SEO。

什么是“hydration”(水合)?

水合是把浏览器中的 JavaScript 代码与服务器已渲染好的 HTML 连接起来的过程,从而让页面变得可交互。

什么是 browser-only peers(仅浏览器端依赖)?

这些代码部分只有在网站运行于用户浏览器中时才能工作,在服务器上无法运行。

详情

作者的原始描述

Integrate markstream-vue into Nuxt 3 or 4 with SSR-safe client boundaries, renderer modes, explicit CSS, and browser-only optional peers.

repo: sickn33/agentic-awesome-skills

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能