我对 Mermaid 的集成有疑问,因为尽管检查了文档并且其他人在 stackoverflow 和其他论坛中要求这个库,但他们给出的示例也是启动这样一个项目。
组件 TS
import { Component, OnInit } from "@angular/core";
import * as mermaid from "mermaid";
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.css"]
})
export class AppComponent implements OnInit {
title = "testMermaid";
public ngOnInit(): void {
mermaid.initialize({
theme: "forest"
});
}
}
HTML
<div class="mermaid">
graph TD A[Hard]
-->|Text| B(Round) B
--> C{Decision} C
-->|One| D[Result 1] C
-->|Two| E[Result 2]
</div>
我希望你能帮我解决这个问题,因为我真的不明白为什么它没有启动任何东西。