API
Component

Toggle ($UI/system/components/justep/button/toggle)

使用范围:UI2

Contents

component Toggle ($UI/system/components/justep/button/toggle) extends Radio

<b>使用场景</b>:绑定数据列后可根据数据集中数据确定开关状态 ## <b>文档链接</b>:#http://docs.newdao.net/chang-wen-ben-and-chang-wen-ben-zu-he.html#

Constructor Top

  Toggle ()
  Toggle ( options)

Properties Top

string label

组件显示名称

string type

组件类型,取值范围:checkbox/radio;

Attributes Top

string class

组件class

string label

组件显示名称

string type

组件类型,取值范围:checkbox/radio;

Methods Top

Object get (String name)
void set (json arg)

Constructor details Top

public Toggle ()

<b>使用场景</b>:绑定数据列后可根据数据集中数据确定开关状态 ## <b>文档链接</b>:#http://docs.newdao.net/chang-wen-ben-and-chang-wen-ben-zu-he.html#

public Toggle ( options)

构造函数

Inherited from ViewComponent

	
		参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
	 

Parameters

options

参数选项

Properties Detail Top

public string label

组件显示名称

	
		包括两部分:
		on: 选中名称
		off: 未选中名称
		this.comp('toggle').set(label:{on:'开',off:'关'});
	

public string type

组件类型,取值范围:checkbox/radio;

Attributes Detail Top

public string class

组件class

	
		基础样式: x-toggle(必须),
		尺寸样式: x-toggle-lg、x-toggle-sm、x-toggle-xs
	

public string label

组件显示名称

	
		包括两部分:
		on: 选中名称
		off: 未选中名称
		this.comp('toggle').set(label:{on:'开',off:'关'});
	

public string type

组件类型,取值范围:checkbox/radio;

Methods Detail Top

public Object get (String name)

获取属性值

Parameters

String name

属性名称,取值范围:"disabled"、"label"、"value"、"checked"、"name"、"type"

Return Value

Object

public void set (json arg)

设置属性值

Parameters

json arg

属性值对
结构如下:

{ "disabled" : 禁用, "label" : 显示名,包括两部分:on: 选中名称 off: 未选中名称;如:this.comp('toggle').set(label:{on:'开',off:'关'}); "value" : 等价于html中的value属性 "checked" : 是否选中 "name" : 组件name,等价于html中的name属性,相同name的Radio为一组,选中是互斥的 "type" : 类型,checkbox/radio }

Return Value

void