var vm = new Vue({
el: "body",
data: {
message: "Hallo Vue",
[...]
}
});
Root Instance
└─ TodoList
├─ TodoItem
│ ├─ DeleteTodoButton
│ └─ EditTodoButton
└─ TodoListFooter
├─ ClearTodosButton
└─ TodoListStatistice
Vue.component('button-counter', {
data: function () {
return {
count: 0
}
},
template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>'
})
<div id="components-demo">
<button-counter></button-counter>
</div>
JS Part
new Vue({ el: '#components-demo' })
“props are properties that can be set in your HTML markup. You can access them in your Vue instance and expose getters and setters to them.”
“one-way-down binding between the child property and the parent one: when the parent property updates, it will flow down to the child”
“data is much more than that. anything in the data will become 'reactive'”
Defined mixins will be mixed into the components context
Defined global mixins will be mixed into EVERY components context in EVERY instance, overwriting style