Scaling UpLesson 21Free preview
Vue Props
This lesson is part of Vue · All levels
Summary
Props are the way the parent component sends data to the child component through attributes, so the child doesn't need to take the data globally. Props are defined in the child component, then the value is passed on by the parent declaratively. In the Composition API, props are taken through the setup parameter or by adding ref to the props argument.
Key points
- Props transmit data from parent to child in one direction.
- The child defines props, the mother fills the value.
- Props should be declared with the data type for validation.
- The name of the props containing the hyphen is written in camelCase in JavaScript.
- Props are read-only and cannot be altered by child components.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.