API
Component

Switch ($UI/wxsys/comps/switch/switch)

使用范围:WX

Contents

component Switch ($UI/wxsys/comps/switch/switch) extends BindComponent

<b>使用场景</b>:小程序中的switch组件,称为开关选择器。有开关和多选按钮两种形态 <b>使用方法</b>:通过“绑定数据列”关联数据中的某列。当列中值为true时,显示选中状态,当列中值为false时,显示为未选中状态。同样,选中时,将true写入数据,取消选中时,写入false ## <b>文档链接</b>:#http://docs.newdao.net/xiao-cheng-xu-biao-dan-zu-jian-2014-2014-ycw/kai-guan-and-kai-guan-zu-he.html#

Constructor Top

  Switch ()
  Switch ( config)

Static Properties & Enumerations Top

String EVENT_VALUE_CHANGE = "valuechange"

值改变事件

Events Top

void valuechange (ValueChangeEvent event)

Constructor details Top

public Switch ()

<b>使用场景</b>:小程序中的switch组件,称为开关选择器。有开关和多选按钮两种形态 <b>使用方法</b>:通过“绑定数据列”关联数据中的某列。当列中值为true时,显示选中状态,当列中值为false时,显示为未选中状态。同样,选中时,将true写入数据,取消选中时,写入false ## <b>文档链接</b>:#http://docs.newdao.net/xiao-cheng-xu-biao-dan-zu-jian-2014-2014-ycw/kai-guan-and-kai-guan-zu-he.html#

public Switch ( config)

构造函数

Inherited from Operational

Parameters

config

操作配置

Static Properties & Enumerations Detail Top

static public String EVENT_VALUE_CHANGE = "valuechange"

值改变事件

Events Detail Top

public void valuechange (ValueChangeEvent event)

值改变

Parameters

ValueChangeEvent event


结构如下:

{ value : 新值, oldValue : 旧值, source : 组件自身 }

Return Value

void