@retailwe/ui-checkbox

0.0.17 • Public • Published

checkbox 多选框

引入

全局引入,在 miniprogram 根目录下的app.json中配置,局部引入,在需要引入的页面或组件的index.json中配置。

// app.json 或 index.json
"usingComponents": {
  "wr-checkbox": "@retailwe/ui-checkbox/index"
}

代码演示

<wr-checkbox items="{{items}}" bindchange="onChange"></wr-checkbox>
Page({
  data: {
    items: [
      { name: '美国', value: 'USA' },
      { name: '中国', value: 'CHN', checked: 'true' },
      { name: '巴西', value: 'BRA' },
      { name: '日本', value: 'JPN', color: 'red' },
      { name: '英国', value: 'ENG', disabled: true },
    ],
  },
  onChange: function(e) {
    console.log(e);
  },
});

checkbox Props

参数 说明 类型 默认值 版本
items object object - -

包含 默认属性 { disbaled color name value checkout} | iClass | 自定义 class 类名 | string | - | - | | disabled | boolean | false | - | - | | color | string | ** | - | - | | name | string | ** | - | - | | value | string | ** | - | - | | checked | boolean | *false* | - | - |

radio Event

事件名 说明 参数
change 组件时触发 -

atention css 只能在全局 Page 修改样式

Readme

Keywords

none

Package Sidebar

Install

npm i @retailwe/ui-checkbox

Weekly Downloads

13

Version

0.0.17

License

none

Unpacked Size

3.44 kB

Total Files

7

Last publish

Collaborators

  • jeannehuang
  • gaterking
  • rachelrgao