refactor: use a default value from a prop
This commit is contained in:
parent
e9082b2e3d
commit
48df94ddf5
|
|
@ -7,7 +7,7 @@ const props = defineProps<{
|
||||||
defaultValue?: string | number
|
defaultValue?: string | number
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const modelValue = defineModel<string | number>({ default: '' })
|
const modelValue = defineModel<string | number>()
|
||||||
modelValue.value = props.defaultValue
|
modelValue.value = props.defaultValue
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ const props = defineProps<{
|
||||||
defaultValue?: string | number
|
defaultValue?: string | number
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const modelValue = defineModel<string | number>({ default: '' })
|
const modelValue = defineModel<string | number>()
|
||||||
modelValue.value = props.defaultValue
|
modelValue.value = props.defaultValue
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user