docs: ESM import

This commit is contained in:
Sidharth Vinod
2022-10-08 09:40:54 +08:00
parent 8a2aea219e
commit 0261e7464a
2 changed files with 4 additions and 6 deletions

View File

@@ -200,9 +200,8 @@ fetch the graph definition from the site (perhaps from a textarea), render it an
The example below show an outline of how this could be used. The example just logs the resulting SVG to the JavaScript console. The example below show an outline of how this could be used. The example just logs the resulting SVG to the JavaScript console.
```html ```html
<script src="mermaid.js"></script> <script type="module">
import mermaid from './mermaid.mjs';
<script>
mermaid.mermaidAPI.initialize({ startOnLoad: false }); mermaid.mermaidAPI.initialize({ startOnLoad: false });
$(function () { $(function () {
// Example of using the API var // Example of using the API var

View File

@@ -200,9 +200,8 @@ fetch the graph definition from the site (perhaps from a textarea), render it an
The example below show an outline of how this could be used. The example just logs the resulting SVG to the JavaScript console. The example below show an outline of how this could be used. The example just logs the resulting SVG to the JavaScript console.
```html ```html
<script src="mermaid.js"></script> <script type="module">
import mermaid from './mermaid.mjs';
<script>
mermaid.mermaidAPI.initialize({ startOnLoad: false }); mermaid.mermaidAPI.initialize({ startOnLoad: false });
$(function () { $(function () {
// Example of using the API var // Example of using the API var