[Vuejs]-Problem while passing data to child component using props in Vue

0👍

You are not accessing the props in the right way.
The correct way to access props in any component is either in an array format or an object format. For example-

First way-

props: ["users"]

Second way-

props: {
  users: {
    required: true // depends if the prop is required or not.
    type: Object // It can be any data type
  }
}

The second way is best to follow as it comes with validations. You can read more about passing and accessing props here-

https://vuejs.org/guide/components/props.html

Leave a comment