File tree Expand file tree Collapse file tree 1 file changed +0
-36
lines changed
packages/svelte/tests/runtime-runes/samples/non-local-mutation-with-binding-8 Expand file tree Collapse file tree 1 file changed +0
-36
lines changed Original file line number Diff line number Diff line change 4444
4545<CounterContext />
4646<CounterBinding bind:linked 3={linked 3.current } bind:linked 4={linked 4.linked .current } />
47-
48- <!-- <script>
49- import { createPortalKey } from 'svelte';
50- let x = createPortalKey();
51- let count = $state(0);
52- let root = $state();
53-
54- $effect(() => {
55- root = document.querySelector('#root');
56- })
57- </script>
58-
59- <div>
60- <svelte:portal for={x}></svelte:portal>
61- </div>
62-
63- <button onclick={() => count++}>increment</button>
64-
65- <svelte:portal target={x}>
66- hello {count}
67- </svelte:portal>
68-
69- {#if count < 5}
70- <svelte:portal target={x}>
71- <span>hello2 {count}</span>
72- </svelte:portal>
73- {/if}
74-
75- <p></p>
76-
77- <svelte:portal target="{root}">
78- I'm rendered in the
79- <button onclick={() => root = document.querySelector('p')}>
80- {root === document.querySelector('#root') ? 'root' : 'p'}
81- </button>
82- </svelte:portal> -->
You can’t perform that action at this time.
0 commit comments