Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1546

Svelte component in plain HTML [duplicate]

$
0
0

I have a function that returns the HTML code for a custom component. That code, together with more HTML code, is then rendered somewhere else with {@html codeToDisplay}.

My firsts two guesses where:

  1. Return the code for the component as I would write it in a Svelte file and hope for Svelte to do it's magic
  2. Return the code for the component but using the special element svelte:component

I also checked out the Custom element API but it didn't work.

I made a small REPL to see what I did.

So my question is: can Svelte render a custom component from valid HTML code?


Viewing all articles
Browse latest Browse all 1546

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>