Kinrany / vue-p5

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

Add Nuxt Support #25

Closed circlebeats closed 4 years ago

circlebeats commented 4 years ago

I've been having trouble getting this to work on Nuxt ssr, pretty sure it is a lifecycle issue. A great feature would be to allow this to be strictly rendered on the client.

Kinrany commented 4 years ago

Hi, thanks for the report. Interesting, do you have an example repo? I don't really have much experience with SSR, but I'll take a look.

Kinrany commented 4 years ago

I'm using mounted to initialize the sketch. I expect the component to render to a single <div/> on the server side. Does this behavior make sense for you?

Kinrany commented 4 years ago

Ah, maybe the problem is that <div/> is not valid HTML, so it will render as <div> on the server, with no closing tag.

I just fixed this issue in v0.8.3. Can you check that it works with Nuxt now?

circlebeats commented 4 years ago

Almost wen't insane trying to figure this out. The problem was with nuxt, it's actually a garbage framework if you need to extend it even in the slightest. Works seamlessly using vue. Thanks!

Kinrany commented 4 years ago

Haha, oh well. Thanks for letting me know :)