Child component:
Vue.component('v-data', {
template: `
<div class="v-data">
<slot :visible-data="visibleData"></slot>
</div>
`,
computed: {
visibleData(){
return [1,2,3];
},
},
});
In parent component I am using it like this:
<v-data>
<li v-for="x in visibleData">{{x}}</li>
</v-data>
but visibleData
is not passed in the template. I should be able to get 1,2,3.
Is there a way to pass variables between components like this?