mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
radio components
This commit is contained in:
parent
cf87bd3603
commit
8f474da314
@ -1 +1,25 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
radio: '1'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
## Radio组件
|
## Radio组件
|
||||||
|
|
||||||
|
### 基础用法
|
||||||
|
|
||||||
|
:::demo
|
||||||
|
```html
|
||||||
|
<o2-radio v-model="radio"></o2-radio>
|
||||||
|
```
|
||||||
|
:::
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
||||||
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
|
| disabled | 是否禁用单选框 | Boolean | false | |
|
||||||
|
11
packages/radio/src/radio-group.vue
Normal file
11
packages/radio/src/radio-group.vue
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<template>
|
||||||
|
<div class="o2-radio-group">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
@ -1,11 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<o2-cell
|
||||||
|
class="o2-radio"
|
||||||
</div>
|
:class="{
|
||||||
|
'is-disabled': disabled
|
||||||
|
}">
|
||||||
|
</o2-cell>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import O2Cell from 'packages/cell';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'o2-radio'
|
name: 'o2-radio',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
O2Cell
|
||||||
|
},
|
||||||
|
|
||||||
|
props: {
|
||||||
|
disabled: Boolean,
|
||||||
|
value: {}
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user