The property on your component is called list , and the value passed to it is tasks .
Let's look at that. First you have your main Vue instance attached to (connected) to the element with the identifier #app . So this is your starting point.
<div id="app"> <tasks list="tasks"></tasks> </div>
inside your div there is a <tasks> . This tag corresponds to a child component, therefore
child = component and parent = vue instance
Correctly. The <tasks> component is an extension of the Vue class, which has only the property declared as list . Areas are important here. Note that the list property belongs to task components and does not matter in its declaration, and the value passed to it in the template (everything inside div #app ) belongs to the parent Vue instance (declared in the Vue instance data ). So why not props:['tasks'] ? Because the <tasks> component has no data or tasks properties . if you really declared the property as tasks, you will need to write your template as follows
<div id="app"> <tasks tasks="tasks"></tasks> </div>
which would be confusing. Therefore, therefore, prop list and because of the declaration of list="tasks" is that the component knows that the list property has the value of an array of parent tasks.
Yerko palma
source share