How can I pass the data from the Vue instance to the Vue component? I'm trying to do 'v-for' on a 'li' that resides in my component template, here's the fiddle
HTML
<div id="app">
<my-notification></my-notification>
</div>
<template id="my-template">
<ul>
<li v-for="nn in notifications">{{ nn }}</li>
</ul>
</template>
Vue script
Vue.component('my-notification',{
template : '#my-template',
});
new Vue({
el : '#app',
data : {
notifications : ['notification 1','notification 2','notification 3']
}
});
Unfortunately what have I tried so far (see my fiddle) is not working, any help please?