ne créé un sketch p5 que dans le contexte du browser

This commit is contained in:
Valentin 2024-05-28 00:37:02 +02:00
parent 4048f92fa4
commit bfef54523e
1 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,9 @@
export default {
mounted() {
this.p5Instance = new p5(this.sketch, this.$refs.canvasContainer);
if (process.client) {
this.p5Instance = new p5(this.sketch, this.$refs.canvasContainer);
}
},
beforeDestroy() {
if (this.p5Instance) {