https://www.npmjs.com/package/vue-mermaid
can work. I've not looked at how it attaches the behavior to the node, there is a way to do it though.