From fea8721f1e08956649180d2c1ba35819d09b8a4b Mon Sep 17 00:00:00 2001 From: jiangruowei Date: Thu, 30 Mar 2017 20:07:03 +0800 Subject: [PATCH] fix: minor fix --- docs/examples-docs/toast.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/docs/examples-docs/toast.md b/docs/examples-docs/toast.md index 0fe2db76c..0c94ba243 100644 --- a/docs/examples-docs/toast.md +++ b/docs/examples-docs/toast.md @@ -38,14 +38,9 @@ export default { type: 'success', message: leftSec.toString() }); - window.setInterval(() => { - if (leftSec <= 0) { - window.clearInterval(); - toast.clear(); - return; - } + cosnt id = window.setInterval(() => { if (leftSec <= 1) { - window.clearInterval(); + window.clearInterval(id); toast.message = '跳转中...' return; } @@ -111,7 +106,7 @@ export default { type: 'success', message: leftSec.toString() }); - window.setInterval(() => { + const id = window.setInterval(() => { if (leftSec <= 1) { window.clearInterval(); toast.message = '跳转中...'