How do I hook into the root Vue object during SSR? #9070
Unanswered
Trinovantes
asked this question in
Questions (Nuxt 2)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
I'm currently looking into migrating my vanilla Vue app into Nuxt. However, I'm encountering an SSR issue with the UI library my app is built on (Quasar). I'm not using their CLI because I want to use Nuxt's SSG which AFAIK isn't supported in Quasar.
My Problem
In order to render Quasar components on the server, it requires calling their
ssrUpdate
to add their$q
object into the root Vue's constructor options (https://github.com/quasarframework/quasar/blob/dev/ui/src/ssr-update.js#L24).I already have a vanilla Vue SSR app implementing this (https://github.com/Trinovantes/MAL-Cover-CSS/blob/master/src/web/app.ts#L48) to verify this behavior. However, I'm not sure how/where to make this function call in Nuxt.
Edit 1:
Ok I figured it out:
Edit 2: Since SSG doesn't have a request/response object, Quasar breaks so I needed this final change to finally compile my app
Beta Was this translation helpful? Give feedback.
All reactions