How can I call hide() on an object on the screen using vue-konva?

202 Views Asked by At

What is the object that is containing the v-xxx item (v-circle for example)? I want to simply call hide() on that object, and thought may be ref plays a key roll, but that was not successful (got this.$refs.testCircle.show is not a function).

Following is the codesandbox I created to illustrate this.

1

There are 1 best solutions below

0
On BEST ANSWER

I should have read the Core API section of https://github.com/konvajs/vue-konva

$refs was correct but had to call getNode() after the referenced node.

So in my example's case, I needed to call

this.$refs.testCircle.getNode().show()