Props in component in Vue.js

Props in Vue is used to pass data from Parent elements to child element. We will see how it works in this article

Component is useless if you are unable to pass data externally

This component does not have access to the data element in parent Vue instance. You can understand it with following example


You will get the following error

To solve this proplem, we can use props
Here, I am passing the prop street to the component


You can add props:['street'] to the Vue instance