s2e24 watching for changes setTimeout

This commit is contained in:
Tyrel Souza 2018-04-13 14:31:39 -04:00
parent 8ac77e11d5
commit d3bdeee2a3
No known key found for this signature in database
GPG Key ID: 5A9394D4C30AEAC0

8
app.js
View File

@ -10,6 +10,14 @@ var app = new Vue({
return this.counter >= 5 ? ">=5" : "<5" return this.counter >= 5 ? ">=5" : "<5"
} }
}, },
watch: {
counter(value){
var vm = this;
setTimeout(function(){
vm.counter = 0;
}, 2000)
}
},
computed: { computed: {
output(){ output(){
console.log("computed"); console.log("computed");