vue-mermaid
vue-mermaid copied to clipboard
Invalid link representation
nodes: [
{
id: "1",
text: "A",
link: ["-- yes -->", "-- no -->"],
next: ["2", "3"],
editable: true
},
{ id: "2", text: "B" },
{ id: "3", text: "C"}
],
Expected: https://raw.githubusercontent.com/robin1liu/vue-mermaid/HEAD/img/links.jpg Actual:
graph LR
1[A]-- yes -->,-- no -->2[B]
1[A]-- yes -->,-- no -->3[C]
2[B]
3[C]
I found a workaround. When defining a separate node, it can be realized.
nodes: [
{
id: "1",
text: "A",
link: ["-- yes -->"],
next: ["2"],
editable: true
},
{
id: "1",
text: "A",
link: ["-- no -->"],
next: ["3"],
editable: true
},
{ id: "2", text: "B" },
{ id: "3", text: "C"}
],
But then why would the link
attribute be an array if it can only have an length of 1? That doesn't make much sense to allude to multiple links via that attribute's data type but then not be able to render it as expected
Of course It is definitely a bug since readme.md shows a node with multiple links are allowed. https://github.com/robin1liu/vue-mermaid#different-link-values-of-next
So, my solution is just a workaround.
Any news about this bug?
I found a comment https://github.com/robin1liu/vue-mermaid/issues/11#issuecomment-569527049 mentioning that modifying vue-mermaid/package.json manually will resolve the bug.
Thanks, but i will prefer your workaround