Widget接口 Widget
Widget接口,控件Class完全实现此接口
渲染
render(renderDom)
参数:
Name | Type | Description |
---|---|---|
renderDom | HtmlElement | 原始html对象 |
设置属性
set(name, val)
参数:
Name | Type | Description |
---|---|---|
name | String | 属性名称 |
val | Any | 属性值 |
获取属性
get(name) → {Any}
参数:
Name | Type | Description |
---|---|---|
name | String | 属性名称 |
返回: 属性值
Type Any
绑定事件
on(type, contextopt, callback)
参数:
Name | Type | Attributes | Description |
---|---|---|---|
type | String | 事件名称 | |
context | Object | optional | 上下文参数,回调函数里可用this.context 获取 |
callback | function | 回调函数 |
解绑事件
off(type, callback)
参数:
Name | Type | Description |
---|---|---|
type | String | 事件名称 |
callback | function | 回调函数 |
调用方法
doMethod(name, …arg) → {Any}
参数:
Name | Type | Attributes | Description |
---|---|---|---|
name | String | 方法名称 | |
arg | Any | <repeatable> | 调用参数 |
返回: 根据方法返回不同值
Type Any
销毁控件
destroy()