Rendering a component in server routes
Hi!
I'd like to return the html of a rendered component in a server route (e.g.
/images/logo
-> should return the html of LogoComponent.vue
)
Would something like this be possible?5 Replies
I tried the following:
but it seems to have a problem with rollup:
also, I'm not sure that creating a new app on every request is the best solution
Why do you need it as a server asset, is it being used from a non-Nuxt site?
I'd like to include it in an
<img>
tag on an external website.
any idea how to fix the error? :/Sorry no. I assume you're wanting to return an SVG?
yes but I want to keep it in the component