# 单选框
用于在多个备选项中选中单个状态。
# 示例
<template>
<div class="wrapper">
<dof-minibar title="4.3单选框"></dof-minibar>
<scroller>
<div class="title-box">
<text class="title-text">基础组件-344</text>
</div>
<div class="box">
<dof-radio-list :isFullBorder="false" :list="list" @dofRadioItemChecked="itemChecked"> </dof-radio-list>
</div>
<div class="title-box">
<text class="title-text">基础组件-375</text>
</div>
<dof-radio-list :list="list2" @dofRadioItemChecked="itemChecked"> </dof-radio-list>
</scroller>
</div>
</template>
<style scoped>
.wrapper {
background-color: #f9f9f9;
}
.title-box {
padding: 32px;
background-color: #e5e5e8;
}
.title-text {
font-family: PingFangSC-Medium;
font-size: 36px;
color: #000000;
font-weight: 500;
}
.box {
padding: 16px 30px 16px 32px;
}
@media screen and (weex-theme: colmo) {
.wrapper {
background-color: #151617;
}
}
</style>
<script>
import { DofMinibar, DofRadioList } from 'dolphin-weex-ui'
export default {
components: { DofMinibar, DofRadioList },
data: () => ({
list: [
{ title: '家庭成员', value: 1, disabled: true },
{ title: '家庭成员', value: 2, checked: true },
{ title: '家庭成员', value: 3 },
{ title: '家庭成员', value: 4 }
],
list2: [
{ title: '家庭成员', value: 1, disabled: true },
{ title: '家庭成员', value: 2 },
{ title: '家庭成员', value: 3, checked: true },
{ title: '家庭成员', value: 4 }
]
}),
created() {},
methods: {
itemChecked(e) {
// this.checkedInfo = e
}
}
}
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Attributes
Prop | Type | Required | Default | Description |
---|---|---|---|---|
list | Array | Y | - | Radio-list单选组 见注1 |
title | String | Y | - | Radio 显示 label |
value | [String、Number] | Y | - | Radio 的 value |
checked | Boolean | N | false | Radio 是否选中 |
disabled | Boolean | N | false | Radio 是否禁用 |
注1: list
const list=[
{ title: '选项1', value: 1 },
{ title: '选项2', value: 2, checked: true},
{ title: '未选不可修改', value: 5, disabled: true },
{ title: '选项3', value: 3},
{ title: '选项4', value: 4}
];
1
2
3
4
5
6
7
2
3
4
5
6
7
# Events
事件名 | 说明 | 回调参数 |
---|---|---|
dofRadioItemChecked | 选择时触发 | e e.value e.title e.oldIndex e.index |
点我扫二维码 查看demo