feat: mermaid
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Component, createSignal, createEffect, onCleanup, Show, createResource } from 'solid-js';
|
||||
import { parseMarkdown } from '../markdown';
|
||||
import { fetchData, extractSection } from '../data-loader';
|
||||
import mermaid from 'mermaid';
|
||||
|
||||
export interface ArticleProps {
|
||||
src: string;
|
||||
@@ -30,6 +31,8 @@ export const Article: Component<ArticleProps> = (props) => {
|
||||
const data = content();
|
||||
if (data) {
|
||||
props.onLoaded?.();
|
||||
// 内容加载完成后,渲染 mermaid 图表
|
||||
void mermaid.run();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user