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
@Dan Levin 's answer works.
methods: { fecthData() { this.data ={ ... }; // assume the fetched data have changed DOM here. this.$nextTick(() => { console.log(this.$refs); // returns obj console.log(this.$refs.target); // returns el }); }
this works also with v-for.