Add default value for number field
This commit is contained in:
parent
1af0b1533b
commit
0fcc182f3b
|
@ -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