Skip to content

Instantly share code, notes, and snippets.

@leochocolat
Created April 24, 2020 20:22
Show Gist options
  • Save leochocolat/7bf904cc1318ecd5e9a504c499804d46 to your computer and use it in GitHub Desktop.
Save leochocolat/7bf904cc1318ecd5e9a504c499804d46 to your computer and use it in GitHub Desktop.
<template>
<canvas class="three-canvas"></canvas>
</template>
<script>
import ThreeCanvasComponent from '~/assets/javascript/components/ThreeCanvasComponent';
export default {
props: {
},
components: {
},
methods: {
setup() {
this.threeScene = new ThreeCanvasComponent({ el: this.$el });
}
},
mounted() {
this.setup()
},
beforeDestroy() {
this.threeScene.destroy()
}
}
</script>
<style>
canvas {
position: fixed;
left: 0;
top: 0;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment