From d3bdeee2a3f0775fcb72e74a3394ab287d1f4c31 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Fri, 13 Apr 2018 14:31:39 -0400 Subject: [PATCH] s2e24 watching for changes setTimeout --- app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app.js b/app.js index c3f91c2..9f8251e 100644 --- a/app.js +++ b/app.js @@ -10,6 +10,14 @@ var app = new Vue({ return this.counter >= 5 ? ">=5" : "<5" } }, + watch: { + counter(value){ + var vm = this; + setTimeout(function(){ + vm.counter = 0; + }, 2000) + } + }, computed: { output(){ console.log("computed");