fix(test): Rerender
This commit is contained in:
parent
d3a81f025a
commit
a017ffc3c9
|
@ -17,11 +17,12 @@
|
||||||
rerender('XMas');
|
rerender('XMas');
|
||||||
|
|
||||||
function rerender(text) {
|
function rerender(text) {
|
||||||
var graphText = `graph TD
|
const graphText = `graph TD
|
||||||
A[${text}] -->|Get money| B(Go shopping)`;
|
A[${text}] -->|Get money| B(Go shopping)`;
|
||||||
var graph = mermaid.mermaidAPI.render('id', graphText);
|
mermaid.mermaidAPI.render('id', graphText).then((svg) => {
|
||||||
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
console.log('\x1b[35m%s\x1b[0m', '>> graph', svg);
|
||||||
document.getElementById('graph').innerHTML = graph;
|
document.getElementById('graph').innerHTML = svg;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
||||||
|
|
Loading…
Reference in New Issue