Kinrany / vue-p5

Vue component for p5.js
125 stars 16 forks source link

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

Open stanleyseow opened 5 years ago

stanleyseow commented 5 years ago

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

Kinrany commented 5 years ago

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!