Add default value for string field

This commit is contained in:
Andrew Kingston 2021-08-04 14:34:06 +01:00
parent 5835c1591f
commit eaaee33906
1 changed files with 2 additions and 0 deletions

View File

@ -7,6 +7,7 @@
export let placeholder export let placeholder
export let type = "text" export let type = "text"
export let disabled = false export let disabled = false
export let defaultValue = ""
let fieldState let fieldState
let fieldApi let fieldApi
@ -16,6 +17,7 @@
{label} {label}
{field} {field}
{disabled} {disabled}
{defaultValue}
type={type === "number" ? "number" : "string"} type={type === "number" ? "number" : "string"}
bind:fieldState bind:fieldState
bind:fieldApi bind:fieldApi