DEV Community

Discussion on: How to use HTML Canvas with Vue

Collapse
 
seedyrom profile image
Zack Kollar • Edited

This is not the correct way to get elements from inside a component, this is the the correct way:

<template>
     <div ref="referenceElement">
     </div>
</template>
<script>
export default {
    name: "FakeComponent",
    mounted() {
        this.$refs["referenceElement"] // This is the correct way to get the internal dom elems!
    }
}
</script>
Enter fullscreen mode Exit fullscreen mode