JSFiddle - React, Tailwind, and code Playground
by yyx990803
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.0-rc.2/vue.js"></script>
<div id="comments">
{{ test }}
<comment-list :comments="comments" inline-template>
<ul>
<li v-for="comment in comments">{{ comment }}</li>
</ul>
</comment-list>
</div>
JavaScript
var data = [
'hello',
'world',
'this',
'does',
'not',
'work'
];
Vue.component('comment-list', {
props: ['comments'],
data: function() {
return {
// comments:data
};
}
});
new Vue({
el: '#comments',
data: {
test: 'Child should display comments',
comments: data
}
});