Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do we mount a Svelte 5 component?#16210

Unanswered
tanin47 asked this question inQ&A
Discussion options

In Svelte 4, I can do something like:

<script src="../somepath/svelte/home/index.js"></script>  <div></div>  <script>    new Index.default({target: document.getElementById('app')});  </script>

I understand we can enablecompatibility.componentApi. However, will we offer a different way that doesn't require wrapping a component in another file simply to getmount?

You must be logged in to vote

Replies: 1 comment

Comment options

If you want a component library that can be used in plain JS, I would recommend exportingmount &unmount from the library itself. Otherwise you can also import those separately; you don't need to wrap every single component.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@tanin47@brunnerh

[8]ページ先頭

©2009-2025 Movatter.jp