Passing properties of the data object in Vue
You can also pass properties of the data
object to child components. Let's look at an example. Let's say we have the following properties:
data() {
return {
name: 'john',
surn: 'smit',
}
}
Let's pass their values to the component:
<template>
<User :name="name" :surn="surn" />
</template>
Let the parent properties store the employee's name, salary, and age. Pass this data to the Employee
component.