vue.jskonvajsvue-konva

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


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.


Solution

  • 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()