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-component-dirty/main.svelte

17 lines
296 B

<script>
export let current_path = 'foo';
export let calls;
let i = 0;
function getComponent(path) {
calls.push(path);
return null;
}
function onClick() {
i = i + 1;
}
</script>
<svelte:component this={getComponent(current_path)} />
<button on:click={onClick}>click me</button>
{i}