props-bindable
Simon Holthausen 10 months ago
parent 376898f62d
commit 0bcc55d52f

@ -1,6 +1,5 @@
<script>
let { value, ...props } = $props();
let { value, ...props } = $props.bindable();
</script>
<button {...props} onclick={() => value++}>{value}</button>

@ -1,5 +1,5 @@
<script>
let { checked, ...rest } = $props();
let { checked, ...rest } = $props.bindable();
</script>
<input type="checkbox" bind:checked {...rest} />

@ -1,5 +1,5 @@
<script>
let { count: definedCount } = $props();
let { count: definedCount } = $props.bindable();
</script>
<button on:click={() => definedCount++}>{definedCount}</button>

@ -1,5 +1,5 @@
<script>
let { bar } = $props();
let { bar } = $props.bindable();
</script>
<button on:click={() => bar--}>{bar}</button>

@ -1,5 +1,5 @@
<script>
let { count } = $props();
let { count } = $props.bindable();
</script>
<button on:click={() => count++}>{count}</button>

@ -1,5 +1,5 @@
<script>
let { readonly, readonlyWithDefault = 1, binding } = $props();
let { readonly, readonlyWithDefault = 1, binding } = $props.bindable();
</script>
<p>

Loading…
Cancel
Save