[Vuejs]-Vue passing data to the component

2👍

You need to instantiate the “Candidates” component in your root Vue instance template then pass the data to that instance specifically. In other words, your template should have something like this:

<candidates :candidates="candidates"></candidates>

What you are doing right now:

<tr v-for="candidate in candidates"
     :candidates="candidates">

is simply supplying your candidates data object to instances of the <tr> element — not a Candidates component.

Leave a comment