Vue components and slots
by Roland Doda
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://npmcdn.com/[email protected]/dist/vue.js"></script>
<div id="app">
</div>
CSS
.slot-item {
font-weight: bold
}
JavaScript
Vue.component('test-list', {
template: 'blank',
props: {
items: Boolean
},
});
var app = new Vue({
el: "#app",
component
data: {
items: [
{id: 1, name: "item 1"},
{id: 2, name: "item 2"},
{id: 3, name: "item 3"},
{id: 4, name: "item 4"},
{id: 5, name: "item 5"},
]
}
});