N
Nuxt10mo ago
SKUPLE

Dynamic Components Nuxt 3 vs Vue

Hey everyone, I’m doing a nuxt 2 > nuxt 3 migration where we have a component library with most of our components. In that library I just maintain the compatibility between vue 2 and vue 3, most of the things are working. However, there is a weird behaviour where dynamic components (with mixed usage between custom components and native elements) seem to only work on SSR. Meaning that in some cases when initially loaded everything seems fine but then navigating to another page and coming back it doesn’t render the dynamic component. I searched the docs and Nuxt now recommends the usage of resolveComponent however I can’t really use it since I need to maintain vue 2 and vue 3 plus storybook (vue 2). I just wanted to ask for a few more examples on dynamic components without resolveComponent since that function isn’t native from Vue. I have tried with just passing the name of the component as a string (works fine on nuxt 2) and also tried passing the component itself. Removing dynamic components and using a bunch of v-if/else makes the whole behaviour disappear and everything seems correct.
3 Replies
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
SKUPLE
SKUPLEOP10mo ago
But those components live in a different package But in any case, do I really need to use resolveComponent?
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server