mand-mobile/components/radio
xuxiaoyan f1cce00843 feat(radio): remove limit of name & value type 2019-02-14 17:00:57 +08:00
..
demo example: update demos for style 2018-12-03 21:29:22 +08:00
mixins fix(radio): extrate props to mixin & remove last option border 2018-12-13 19:58:02 +08:00
test test: update snapshots 2019-01-29 11:34:25 +08:00
README.en-US.md feat(radio): remove limit of name & value type 2019-02-14 17:00:57 +08:00
README.md feat(radio): remove limit of name & value type 2019-02-14 17:00:57 +08:00
component.js feat(code clean up): 2018-09-24 15:48:57 +08:00
index.vue feat(radio): remove limit of name & value type 2019-02-14 17:00:57 +08:00
list.vue feat(radio): remove limit of name & value type 2019-02-14 17:00:57 +08:00

README.en-US.md

title preview
Radio https://didi.github.io/mand-mobile/examples/#/radio

Customizable or editable radio buttons

Import

import { Radio } from 'mand-mobile'

Vue.component(Radio.name, Radio)

Code Examples

API

Radio Props

属性 说明 类型 默认值 备注
v-model selected name any -
name unique name any - -
label description text String- -
disabled whether disable option Boolean false -
inline whether display as inline block Boolean false -
icon selected icon name String checked -
icon-inverse icon name String check -
icon-disabled icon of disabled options String check-disabled -
icon-svg use svg icon Boolean false -
size size of icon String md -

Radio List Props

Props Description Type Default Note
v-model value of the selected item any - -
options option data source Array<{text, value, disabled, ...}> [] disabled is to disable option or not
has-input has editable item or not Boolean false -
input-label name of editable item String - only when has-input is true
input-placeholder placeholder of editable item String - only when has-input is true
icon icon of selected option String checked -
icon-inverse icon of unselected options String check -
icon-disabled icon of disabled options String check-disabled -
icon-size the size of icon String lg -
icon-svg use svg icon Boolean false -
icon-position the position of icon String left left, right
is-slot-scope if it is mandatory to use slot-scope Boolean - it depends on exact cases to determine whether to use it or not, and avoids adding if/else to component

Radio List Methods

select(value)

Set selected value

Parameters Description Type
value value of option String

Radio List Events

@change(option, index)

Selected option changed

Props Description Type
option data of selected option Object:{text, value, disabled, ...}
index index of selected option Number

Radio List Slots

<template>
  <md-radio-list :options="data">
    <template slot-scope="{ option }">
      <div class="custom-title" v-text="option.text"></div>
      <div class="custom-brief">{{ option.text }}的自定义描述</div>
    </template>
  </md-radio-list>
</template>