Props MUST be defined using TypeScript interface with defineProps<Props>().
Default values MUST be defined using withDefaults().
Optional props MUST use the ? syntax.
Example:
interface Props {
product: Product
variant?: 'primary' | 'secondary'
discount?: number
categories?: Category[]
}
const props = withDefaults(defineProps<Props>(), {
variant: 'primary',
categories: () => [],
})