Props

You use props to allow a component to receive input from its parent. Props are immutable in the child component and are defined as part of the component definition object as shown in the following code:

<script>export default {  name: 'Child',  props: {    greet: String,  },}</script>

In the preceding code, the Child component expects an input from its parent, specifically, a prop named greet of the type String.

Props support more definitions, such as default values and validation. You can read more about it here: https://vuejs.org/v2/guide/components-props.html.

Get Hands-On Full-Stack Web Development with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.