LinusBorg / portal-vue

A feature-rich Portal Plugin for Vue 3, for rendering DOM outside of a component, anywhere in your app or the entire document. (Vue 2 version: v2.portal-vue.linusb.org)
http://portal-vue.linusb.org
MIT License
3.9k stars 187 forks source link

Add support for SSG #373

Closed xaddict closed 1 year ago

xaddict commented 2 years ago

portal-vue can be used in Nuxt and it works great in Server Side Rendered Mode and Live mode, but it breaks in Static Site Generator mode where the contents cannot be pre-rendered by the script Nuxt uses to do so.

When hydration works, the contents get inserted as soon as the javascript kicks in but it would be a major help if PortalVue supported pre-rendered static pages through Nuxt. This would make dynamic header images in Nuxt sites way easier to implement.

PS. I'm not sure if this is even possible while also supporting Vue, and I'm not sure if this is a Nuxt problem or a PortalVue problem. I just though to ask here.

LinusBorg commented 1 year ago

SSG won't really be possible with the technical approach I took for portal-vue.