3👍
✅
Adding a Default Value using withDefaults
in the Vue 3 Composition API:
interface InputProps {
message: string
error?: string
}
const props = withDefaults(defineProps<InputProps>(), {
message: null
})
learn more here
Source:stackexchange.com