I'm experimenting with Vue 2.0 and I've encountered a bit of confusion. How can I properly pass props to a component's internal data? I've followed the documentation, but it still seems unclear.
HTML
<service-list :services="model"></service-list>
The "model" data has already been defined.
THE VUE COMPONENT
Vue.component('service-list', {
template: '<span class="blue">{{serviceList.yellowLine.description}}</span>',
props: ['services'],
data: function(){
return{
serviceList: this.services
}
}
In essence, I am attempting to set the value of the data property serviceList equal to the prop services. However, I am receiving the following error message in the console:
[Vue warn]: Error in render function: "TypeError: Cannot read property 'description' of undefined"
found in
---> <ServiceList>
<Root>