From 9225d5e7feff6c09919632eea3525fae1e6f2ea3 Mon Sep 17 00:00:00 2001 From: pimlie Date: Thu, 12 Sep 2019 12:11:36 +0200 Subject: [PATCH] example: cleartimeout in ssr example --- examples/vue-router/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/vue-router/app.js b/examples/vue-router/app.js index 4592677..c3c1439 100644 --- a/examples/vue-router/app.js +++ b/examples/vue-router/app.js @@ -30,9 +30,12 @@ const ChildComponent = { } }, mounted () { - setInterval(() => { + this.interval = setInterval(() => { this.date = new Date() }, 1000) + }, + destroyed () { + clearInterval(this.interval) } }