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
|
||||
}>()
|
||||
|
||||
const modelValue = defineModel<string | number>({ default: '' })
|
||||
const modelValue = defineModel<string | number>()
|
||||
modelValue.value = props.defaultValue
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const props = defineProps<{
|
|||
defaultValue?: string | number
|
||||
}>()
|
||||
|
||||
const modelValue = defineModel<string | number>({ default: '' })
|
||||
const modelValue = defineModel<string | number>()
|
||||
modelValue.value = props.defaultValue
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user