1.0.4 • Published 7 years ago

mp-select v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

mp-select

小程序自定义选择组件

使用

安装

npm install --save --production mp-select

引入

{
  "usingComponents": {
    "mp-select": "/miniprogram_npm/mp-select/index"
  }
}

使用

wxml

<mp-select type="select" range="{{range}}" value="{{value}}" bindsaveevent="bindchange" bindcancelevent="cancel" wx:if="{{show}}" ></mp-select>

js

显示

select () {
  this.setData({
    show: true
  })
}

选择

bindchange (e) {
  this.setData({
    value: e.detail.value,
    show: false
  })
}

取消

cancel () {
  this.setData({
    show: false
  })
}

配置

type

select 默认 单选

multiple 多选

checkbox 复选框

require

单选模式下设置 require 默认选中第一项

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago