使用范围:UI2
Contents
component Timer ($UI/system/components/justep/timer/timer) extends ViewComponent
Constructor Top
Timer () | |||
Timer ( options) |
Properties Top
boolean |
enabled
启用timer,默认:true | ||
integer |
interval
触发间隔,单位为毫秒,默认:1000 | ||
integer |
times
触发次数,0:无限,默认:0 |
Attributes Top
boolean |
enabled
启用timer,默认:true | ||
integer |
interval
触发间隔,单位为毫秒,默认:1000 | ||
integer |
times
触发次数,0:无限,默认:0 | ||
string |
xid
组件标示 |
Methods Top
Object | get (String name) | |
void | pause () | |
void | set (json arg) | |
void | start () | |
void | stop () |
Operations Top
void | timerPause () | |
void | timerStart (integer times, integer interval) | |
void | timerStop () |
Events Top
void | onStop (ViewEvent event) | |
void | onTimer (TimerEvent event) |
Constructor details
Top
public
Timer
()
使用场景:可实现定时任务效果;
使用方法:设置计时器相关属性和触发事件后,可在组件事件(如按钮点击事件)中控制计时器的启动、停止、暂停;
##
文档链接:#http://docs.newdao.net/zhuo-mian-biao-dan-zu-jian/ji-shi-qi.html#
public
Timer
( options)
构造函数
Inherited from ViewComponent
参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
public
Timer
()
public
Timer
( options)
构造函数
Inherited from ViewComponent
参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
Properties Detail Top
public
boolean
enabled
启用timer,默认:true
public
integer
interval
触发间隔,单位为毫秒,默认:1000
public
integer
times
触发次数,0:无限,默认:0
Attributes Detail Top
public
boolean
enabled
启用timer,默认:true
public
integer
interval
触发间隔,单位为毫秒,默认:1000
public
integer
times
触发次数,0:无限,默认:0
public
string
xid
组件标示
Methods Detail Top
public
Object
get
(String name)
获取属性值
public
void
pause
()
暂停,调用timer.start()后可继续
See Pause
public
void
set
(json arg)
设置属性值
public
void
start
()
开始,等同于timer.set('enabeld',true)
See Start
public
void
stop
()
停止,等同于timer.set('enabeld',false)
See Stop
Operations Detail Top
public
void
timerPause
()
计时器暂停
See TimerPause
public
void
timerStart
(integer times, integer interval)
启动计时器
See TimerStart
public
void
timerStop
()
计时器停止
See TimerStop
Events Detail Top
[回调型事件]timer停止事件
[回调型事件]timer触发事件