mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
25 lines
555 B
TypeScript
25 lines
555 B
TypeScript
import styles from "./index.css?inline"
|
|
import { mount } from "svelte"
|
|
import type { ComponentType } from "svelte"
|
|
|
|
export default function renderSvelte(
|
|
Component: ComponentType | any,
|
|
mountPoint: ShadowRoot | HTMLElement,
|
|
props: Record<string, any> = {},
|
|
) {
|
|
const app = mount(Component, {
|
|
target: mountPoint,
|
|
props: {
|
|
standalone: false,
|
|
...props,
|
|
},
|
|
})
|
|
|
|
const style = document.createElement("style")
|
|
style.setAttribute("type", "text/css")
|
|
style.innerHTML = styles
|
|
mountPoint.appendChild(style)
|
|
|
|
return app
|
|
}
|