I've encountered an issue while trying to pass a prop from the main Vue instance to a component. While one of the props is being successfully passed, the second one seems to be causing some trouble.
Main Instance
var app7 = new Vue({
el: '#app-7',
template: `<div class="b">
<div>
<button class="c" v-on:click="previousDay">‹</button>
<h1 >{{ this.ss }}</h1>
<button class="c" v-on:click="nextDay">›</button>
<div>
<emp-item
v-for="item in empList"
v-bind:emp="item"
v-bind:key="item.id">
v-bind:lines="lines"
</emps-item>
</div>`,
data: function() {
return {
empList : l,
lines: 0,
day: 0
}
// other stuff
Component
Vue.component('emp-item', {
props: ['emp', 'lines'],
template: `<div class="cv">
<h6>{{emp.first_name}} {{ lines }}</h6>
<canvas v-on:mousedown="mouseDown" v-on:mousemove="mouseMove" v-on:mouseup="mouseUp" :id="'cv' + emp.id" class="canvas" width="150" height="700"></canvas>
</div>`,
data: function() {
return {
rect : {},
drag : false,
startTime : 0,
cv: ''
}
},
watch: {
lines: function () {
console.log('watch: ');
}
},
// methods
If it makes a difference HTML
<div id="app-7">
<app></app>
</div>