API
Class

Component ($UI/wxsys/lib/base/component)

使用范围:WX

Contents

class Component ($UI/wxsys/lib/base/component) extends Operational

组件基类

Constructor Top

  Component ()
  Component ( config)

Properties Top

string id

组件标识

Attributes Top

string id

组件标识

Methods Top

void buildState (Any context)
void destroy ()
String getCompid ()
Any getContext ()
String getStatePath ()
Any getValueByPath (String path, String prop)
Any setValue (String path, String prop, Any value, Function callback)
void willBuildState (Any context)
void willBuildState (Any context)

Events Top

void longtap (CustomEvent event)
void tap (CustomEvent event)
void touchcancel (TouchEvent event)
void touchend (TouchEvent event)
void touchmove (TouchEvent event)
void touchstart (TouchEvent event)

Constructor details Top

public Component ()

组件基类

public Component ( config)

构造函数

Inherited from Operational

Parameters

config

操作配置

Properties Detail Top

public string id

组件标识

Attributes Detail Top

public string id

组件标识

Methods Detail Top

public void buildState (Any context)

构建组件状态(子类重载)

Parameters

Any context

上下文

Return Value

void

public void destroy ()

组件释放(子类重载)

Return Value

void

public String getCompid ()

获取组件标识

Return Value

String

public Any getContext ()

获取上下文

Return Value

Any

public String getStatePath ()

获取组件状态路径

Return Value

String

public Any getValueByPath (String path, String prop)

根据路径获取数据的值

Parameters

String path

路径

String prop

属性名

Return Value

Any

public Any setValue (String path, String prop, Any value, Function callback)

根据路径设置数据的值

Parameters

String path

路径

String prop

属性名

Any value

Function callback

设置成功后的回调

Return Value

Any

public void willBuildState (Any context)

即将构建组件状态(子类重载)

Parameters

Any context

上下文

Return Value

void

public void willBuildState (Any context)

即将构建组件状态(子类重载)

Parameters

Any context

上下文

Return Value

void

Events Detail Top

public void longtap (CustomEvent event)

长按事件

Parameters

CustomEvent event


结构如下:

{ type : 事件类型, timeStamp : 事件生成时的时间戳, target : 触发事件的组件的一些属性值集合, currentTarget : 当前组件的一些属性值集合, dataset: 额外信息 }

Return Value

void

public void tap (CustomEvent event)

点击事件

Parameters

CustomEvent event


结构如下:

{ type : 事件类型, timeStamp : 事件生成时的时间戳, target : 触发事件的组件的一些属性值集合, currentTarget : 当前组件的一些属性值集合, dataset: 额外信息 }

Return Value

void

public void touchcancel (TouchEvent event)

触摸动作被打断,如来电提醒,弹窗

Parameters

TouchEvent event

Return Value

void

public void touchend (TouchEvent event)

触摸动作结束

Parameters

TouchEvent event

Return Value

void

public void touchmove (TouchEvent event)

触摸后移动

Parameters

TouchEvent event

Return Value

void

public void touchstart (TouchEvent event)

触摸动作开始

Parameters

TouchEvent event

Return Value

void