You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/dynamic-element-action-update/main.svelte

15 lines
382 B

<script>
export let logs = [];
export let tag = "h1";
export let opt = "opt1";
function foo(node, {tag, opt}) {
logs.push(`create: ${tag},${opt}`);
return {
update: ({tag, opt}) => logs.push(`update: ${tag},${opt}`),
destroy: () => logs.push('destroy'),
};
}
</script>
<svelte:element this={tag} use:foo={{tag, opt}}>tag is {tag}.</svelte:element>