I am trying to use an external JS library that generates a drawing canvas (atrament.js) within a vue.js app.
I am not sure what is the right way of doing this. Right now I am just doing:
<script type="text/javascript">
var main = new Vue({
el: '#vueapp'
});
</script>
<script type="text/javascript">var atr = atrament("canvas", 500, 500);</script>
And with that the canvas is generated wherever I put the <canvas></canvas>
tags.
However, this does not seem a very elegant option, and the atr
var is not accessible for the vue app, for example for clearing the canvas. So, which is the right way of doing this?