vue-p5 icon indicating copy to clipboard operation
vue-p5 copied to clipboard

What is the differences between p5 as vue container vs running both separately ??

Open stanleyseow opened this issue 4 years ago • 1 comments

Not as issue but more of a question(s) ...

I found this, running Vue, Vuex & p5 as individual libs .. https://codepen.io/etheralgo/pen/KjKQjZ

What are the major differences of this vs running as a Vue container ?

Thanks

stanleyseow avatar Aug 19 '19 10:08 stanleyseow

Not as issue but more of a question(s) ...

That's totally fine :)

The idea was to make it possible to embed multiple p5 apps as a component in a complex Vue app. Usually a component would use a <template> tag or a render function instead of mounting to an existing element (aka "hydrating", I think). There are some caveats around instantiating/cleaning up the sketch. My goal was to reuse this logic between projects, and it seemed natural that the easiest way is to make a p5 sketch a component.

It's totally possible that there's a better way, let me know if you find one!

Kinrany avatar Aug 19 '19 11:08 Kinrany