6👍
✅
this.$el
in this case is a reference to div#container
. What you want to do is use a ref.
ref is used to register a reference to an element or a child
component. The reference will be registered under the parent
component’s $refs object
<div class="container">
<canvas ref="canvas" width="900" height="400"></canvas>
</div>
And then
this.$refs.canvas.getContext('2d')
Source:stackexchange.com