API
Component

Button ($UI/system/components/justep/button/button)

使用范围:UI2

Contents

component Button ($UI/system/components/justep/button/button) extends BindComponent

<b>双击即可直接编辑按钮文本</b> ## <b>文档链接</b>:#http://docs.newdao.net/appnei-rong-zu-4ef6-lhj/an-niu.html#

Constructor Top

  Button ()
  Button ( options)

Properties Top

boolean disabled

禁用

string icon

图标,支持fontIcon和img两种模式,fontIcon格式:"icon-refresh",img格式:"img:xxx.png|xxx.png"(包含可用、不可用两个显示图片)

string label

显示名

string target

关联组件,当button点击时自动激活关联组件

Attributes Top

string class

组件class

boolean disabled

禁用

string icon

图标,支持fontIcon和img两种模式,fontIcon格式:"icon-refresh",img格式:"img:xxx.png|xxx.png"(包含可用、不可用两个显示图片)

string label

显示名

string target

关联组件,当button点击时自动激活关联组件

string xid

组件标示

Methods Top

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

Events Top

void onClick (ViewEvent event)

Constructor details Top

public Button ()

<b>双击即可直接编辑按钮文本</b> ## <b>文档链接</b>:#http://docs.newdao.net/appnei-rong-zu-4ef6-lhj/an-niu.html#

public Button ( options)

构造函数

Inherited from ViewComponent

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

Parameters

options

参数选项

Properties Detail Top

public boolean disabled

禁用

public string icon

图标,支持fontIcon和img两种模式,fontIcon格式:"icon-refresh",img格式:"img:xxx.png|xxx.png"(包含可用、不可用两个显示图片)

public string label

显示名

public string target

关联组件,当button点击时自动激活关联组件

Attributes Detail Top

public string class

组件class

	
		基础样式: btn(必须),
		颜色样式: btn-default、btn-primary、btn-success、btn-info、btn-warning、btn-danger、btn-link、x-black、x-blue、x-orange、x-green、x-red、x-yellow、x-purple、x-gray
		尺寸样式: btn-lg、btn-sm、btn-xs
		图标位置: btn-icon-left、btn-icon-top、btn-icon-right、btn-icon-bottom
		展现:     btn-only-icon(只显示图标,可以用于屏蔽操作中指定的label)、btn-only-label(只显示文字,可以用于屏蔽操作中指定的图标)
		扩展:     btn-block
	

public boolean disabled

禁用

public string icon

图标,支持fontIcon和img两种模式,fontIcon格式:"icon-refresh",img格式:"img:xxx.png|xxx.png"(包含可用、不可用两个显示图片)

public string label

显示名

public string target

关联组件,当button点击时自动激活关联组件

public string xid

组件标示

Methods Detail Top

public Object get (String name)

获取属性值

Parameters

String name

属性名称,取值范围:"disabled"、"label"、"icon"、"target"

Return Value

Object

public void set (json arg)

设置属性值

Parameters

json arg

属性值对
结构如下:

{ "disabled" : 禁用, "label" : 显示名 "icon" : 图标,支持fontIcon和img两种模式,fontIcon格式:"icon-refresh",img格式:"img:xxx.png|xxx.png"(包含可以、不可用两个显示图片) "target" : 关联组件XID,当button点击时自动激活关联组件 }

Return Value

void

Events Detail Top

public void onClick (ViewEvent event)

[回调型事件]点击按钮触发事件

Parameters

ViewEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明 }

Return Value

void