4👍
You need to use withDefaults
type Props = {
type?: string
color?: 'color-primary' | 'color-danger' | 'color-plain' | undefined
}
const props = withDefaults(defineProps<Props>(), {
type: 'plain',
color: 'color-plain',
})
👤cos
Source:stackexchange.com