/
dimamir
/
ory-kit
Обзор
Документация
Войти
/
dimamir
/
ory-kit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
development
authentication/src/lib/components/ory/internal/FlowScript.svelte
34 строки
1 KB
Markus Thielker
ORY-49: add documentation to internal components
29 дек 2023, 02:51
29 дек 2023, 02:51
b5283bb
Код
Авторство
О чём код?
<script lang="ts"> import { onMount } from "svelte"; import type { UiNode, UiNodeScriptAttributes } from "@ory/client"; import { browser } from "$app/environment"; /** the node to render */ export let node: UiNode; const attributes = node.attributes as UiNodeScriptAttributes; const script = document.createElement("script") onMount(() => { if (browser) { script.async = true script.src = attributes.src script.async = attributes.async script.crossOrigin = attributes.crossorigin script.integrity = attributes.integrity script.referrerPolicy = attributes.referrerpolicy script.type = attributes.type document.body.appendChild(script) } return () => { document.body.removeChild(script) } }) </script> <!-- @component # Do NOT use this internal component outside of the flow component tree! This component is used by the flow component to render a script node. -->