mand-mobile/components/check-group
moyu 97ad2469bc doc: Improve component readme (#156) 2018-07-23 18:40:24 +08:00
..
demo feat(check): add check-group component (#147) 2018-07-20 14:06:03 +08:00
test feat(check): add check-group component (#147) 2018-07-20 14:06:03 +08:00
README.en-US.md doc: Improve component readme (#156) 2018-07-23 18:40:24 +08:00
README.md doc: Improve component readme (#156) 2018-07-23 18:40:24 +08:00
component.js feat(check): add check-group component (#147) 2018-07-20 14:06:03 +08:00
index.vue feat(check): add check-group component (#147) 2018-07-20 14:06:03 +08:00

README.en-US.md

title preview
CheckGroup https://didi.github.io/mand-mobile/examples/#/check-group

UI renderless check group component. 1.5.0+

Import

import {  CheckGroup } from 'mand-mobile'

Vue.component(CheckGroup.name, CheckGroup)

Code Examples

API

CheckGroup Props

|属性 | 说明 | 类型 | 默认值 | 备注 || Props | Description | Type | Default | Note ||----|-----|------|------|------| |v-model|selected values|[String,Array]|-|-| |options|option array|Array|-|-| |max|max select options|Number|1|0: no limits; 1: only allow select one; 2 or more: only allow select 2 options| |disabled|whether disable selection or not|Boolean|false|-|

options

The structure of option arrayvalue is required。

[
  { value: '', disabled: false }
]

CheckGroup Methods

select(value)
Argument Description Type Default
value the option value you want to add [String, Array] -

CheckGroup Slots

CheckGroup default slot will be used as template, and it will receive {option, select} from slot-scope. The option has all props you pass to component and isSelected prop.

<md-check-group
  v-model="selected"
  :options="options"
>
  <div slot-scope="{ option, select }" @click="select(option.value)">
    ...
  </div>
</md-check-group>