vitepress中使用mermaid

vitepress中使用mermaid

使用方法

安装依赖

css 复制代码
npm i vitepress-plugin-mermaid mermaid -D

config.ts文件修改如下:

javascript 复制代码
// import { defineConfig } from 'vitepress'
import { withMermaid } from 'vitepress-plugin-mermaid'

// export default defineConfig({
//   
// })

export default withMermaid({
  // 将defineConfig下的配置内容放在此处即可正常使用mermaid
})

.md文件中使用mermaid页面即可绘制流程

css 复制代码
```mermaid
graph LR
    A[源代码] -->|Rollup 打包| B[优化后的静态资源]
    C[依赖库] -->|代码分割| B
```

页面展示效果

graph LR A[源代码] -->|Rollup 打包| B[优化后的静态资源] C[依赖库] -->|代码分割| B
相关推荐
Hooray28 分钟前
为了在 Vue 项目里用上想要的 React 组件,我写了这个 skill
前端·ai编程
咸鱼翻身了么30 分钟前
模仿ai数据流 开箱即用
前端
风花雪月_30 分钟前
🔥IntersectionObserver:前端性能优化的“隐形监工”
前端
Bigger31 分钟前
告别 AI 塑料感:我是如何用 frontend-design skill 重塑项目官网的
前端·ai编程·trae
发际线向北31 分钟前
0x02 Android DI 框架解析之Hilt
前端
zhensherlock44 分钟前
Protocol Launcher 系列:Overcast 一键订阅播客
前端·javascript·typescript·node.js·自动化·github·js
liangdabiao1 小时前
开源AI拼豆大升级 - 一键部署cloudflare page - 全免费 web和小程序
前端·人工智能·小程序
SuperHeroWu72 小时前
【鸿蒙基础入门】概念理解和学习方法论说明
前端·学习·华为·开源·harmonyos·鸿蒙·移动端
Full Stack Developme2 小时前
MyBatis-Plus 流式查询教程
前端·python·mybatis
用户412467508372 小时前
用 Locust 压测一个网站,记录一下学习过程
前端