Slide 10
Slide 10 text
Data, Methods, Computed, Watch
data() function! else shared
between instances
props:
methods:
computed:
watch: generic observer, good for heavy async computation
https://vuejs.org/v2/guide/computed.html
data() {
return {
todos: [‘string‘],
}
},
// Like methods, but are cached until dependency changes
computed: {
counterDone () {
return this.todos.filter(todo => todo.done).length
},
},