Vue · Senior · Question 68 of 75
How do you type a complex prop in the Options API?
props: {
user: { type: Object as PropType<User>, required: true },
}- ✓Correct answer: Cast the constructor with
PropType<T> - 2Use
type: User - 3Props in the Options API can't be typed
Explanation
Runtime type checks only the constructor (Object); PropType gives TypeScript the exact shape.