mirror of https://github.com/sveltejs/svelte
parent
73398f1d9d
commit
b9f0273328
@ -0,0 +1,12 @@
|
||||
<script>
|
||||
|
||||
let { children } = $props()
|
||||
|
||||
const snippetProps = $derived.by(() => ({
|
||||
id: '123',
|
||||
name: 'my-select'
|
||||
}))
|
||||
|
||||
</script>
|
||||
|
||||
{@render children({ props: snippetProps })}
|
||||
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: '<select id="123" name="my-select"><option>A</option><option>B</option><option>C</option></select>'
|
||||
});
|
||||
@ -0,0 +1,19 @@
|
||||
<svelte:options runes={false} />
|
||||
|
||||
<script>
|
||||
import { writable } from 'svelte/store'
|
||||
import Comp from './Comp.svelte'
|
||||
|
||||
const myStore = writable('')
|
||||
|
||||
</script>
|
||||
|
||||
<Comp>
|
||||
{#snippet children({ props })}
|
||||
<select {...props} bind:value={$myStore} >
|
||||
<option>A</option>
|
||||
<option>B</option>
|
||||
<option>C</option>
|
||||
</select>
|
||||
{/snippet}
|
||||
</Comp>
|
||||
Loading…
Reference in new issue