提交 054fc7b2 编写于 作者: Isaac_Lau's avatar Isaac_Lau 提交者: Joker

update docs/api/timer.md.

对 setInterval 方法的参数描述进行修改,增加对 setInterval 方法的简单调用示例
上级 efa22367
......@@ -36,7 +36,7 @@
|参数|类型|必填|说明|
|:-|:-|:-|:-|
|callback|Function|是|回调函数|
|delay|Number|否|延迟的时间,函数的调用会在该延迟之后发生,单位 ms|
|delay|Number|否|执行回调函数之间的时间间隔,单位 ms|
|rest|Any|否|param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数|
......@@ -46,6 +46,12 @@
|:-|:-|:-|
|intervalID|Number|定时器的编号,这个值可以传递给 [clearInterval](/api/timer?id=clearinterval) 来取消该定时|
**代码示例**
```
this.timer = setInterval(() => {
//TODO
}, 1000);
```
## clearInterval(intervalID)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册