Actually use input value

This commit is contained in:
2025-03-09 17:48:31 +01:00
parent 6e7dd7a560
commit 46feef3a48
2 changed files with 17 additions and 10 deletions

View File

@@ -4,14 +4,15 @@
type Props = {
text: string;
action: () => void;
action: (arg: number) => void;
value: number;
};
let { action, text }: Props = $props();
let { action, text, value = $bindable() }: Props = $props();
</script>
<div>
<h2>{text}</h2>
<Input placeholder={"1"} type="tel" />
<Button onclick={action}>Submit</Button>
<Input placeholder={"1"} type="tel" bind:value />
<Button onclick={() => action(value)}>Submit</Button>
</div>