Add default value for number field
This commit is contained in:
parent
12d5ccb3a7
commit
bbf9f42555
|
@ -1,5 +1,11 @@
|
|||
<script>
|
||||
import StringField from "./StringField.svelte"
|
||||
|
||||
export let defaultValue
|
||||
</script>
|
||||
|
||||
<StringField {...$$props} type="number" />
|
||||
<StringField
|
||||
{...$$props}
|
||||
type="number"
|
||||
defaultValue={isNaN(defaultValue) ? null : parseFloat(defaultValue)}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue