Vuejs can't access refs from component

后端 未结 7 1365
终归单人心
终归单人心 2020-12-17 07:45

I am trying to get the canvas element which is inside a template of a component, found great documentations for vuejs1 but not for vuejs2 where "ref" is the only w

7条回答
  •  旧时难觅i
    2020-12-17 08:27

    To point at vue instance to self variable worked for me, info source

    created() {
        let self = this;
        console.log(self.$refs.icanvas);
    },
    

提交回复
热议问题