N
Nuxt5mo ago
KasparsCP

Anyway to access root div id=__nuxt content and use it inside a slot?

In Vue it is possible to access HTML content which is inside original <DIV id="__nuxt"> tags and move it to <slot> afterwards. However I can't achieve it on Nuxt3. Example content in index.html page: <body><div id="__nuxt"><strong>Some content here</strong></div></body> Now in specific place in my layout or page I need to show this part <strong>Some content here</strong>. Any ideas? thanks
2 Replies
Orbis
Orbis5mo ago
depending on what you want to achieve, this may help you https://nuxt.com/docs/api/nuxt-config#spaloadingtemplate
KasparsCP
KasparsCPOP5mo ago
Thank you, will look into it. For the use case, I wanted to return some parts of HTML by backend on initial load and "inject" it, or teleport into nuxt client side app.

Did you find this page helpful?