Skip to content

Commit b9f0273

Browse files
committed
add test
1 parent 73398f1 commit b9f0273

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script>
2+
3+
let { children } = $props()
4+
5+
const snippetProps = $derived.by(() => ({
6+
id: '123',
7+
name: 'my-select'
8+
}))
9+
10+
</script>
11+
12+
{@render children({ props: snippetProps })}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { test } from '../../test';
2+
3+
export default test({
4+
html: '<select id="123" name="my-select"><option>A</option><option>B</option><option>C</option></select>'
5+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<svelte:options runes={false} />
2+
3+
<script>
4+
import { writable } from 'svelte/store'
5+
import Comp from './Comp.svelte'
6+
7+
const myStore = writable('')
8+
9+
</script>
10+
11+
<Comp>
12+
{#snippet children({ props })}
13+
<select {...props} bind:value={$myStore} >
14+
<option>A</option>
15+
<option>B</option>
16+
<option>C</option>
17+
</select>
18+
{/snippet}
19+
</Comp>

0 commit comments

Comments
 (0)