# 多选框

用于在一组可选项中进行多项选择时。

# 示例


<template>
  <div class="wrapper">
    <dof-minibar title="4.4多选框"></dof-minibar>
    <scroller>
      <div class="title-box">
        <text class="title-text">基础组件</text>
      </div>
      <div class="content">
        <div class="checkboxBox">
          <dof-checkbox-list
            :list="list"
            :hasBottomBorder="false"
            :hasSubBottomBorder="false"
            @dofCheckBoxListChecked="checkBoxClicked"
          >
          </dof-checkbox-list>
        </div>
      </div>
    </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;
}
.content {
  padding-top: 16px;
  padding-bottom: 16px;
}
.checkboxBox {
  background-color: #fff;
}

@media screen and (weex-theme: colmo) {
  .wrapper {
    background-color: #151617;
  }
  .checkboxBox {
    background-color: #1d1f22;
  }
}
</style>

<script>
import { DofMinibar, DofCheckboxList } from 'dolphin-weex-ui'
export default {
  components: { DofMinibar, DofCheckboxList },
  data: () => ({
    list: [
      {
        title: '列表',
        value: 1,
        checked: true
      },
      {
        title: '列表',
        value: 2
      },
      {
        title: '列表',
        value: 3
      }
    ],
    checkedList: [1]
  }),
  created() {},
  methods: {
    checkBoxClicked(e) {
      this.checkedList = e.checkedList
    }
  }
}
</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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

# Attributes

Prop Type Required Default Description
title String Y - checkbox展现的label
value [String、Number、Object] Y - checkbox展现的value
checked Boolean N false checkbox是否选中
disabled Boolean N false 是否 disabled
item-img String N - 覆盖颜色和 icon
tag String N - 标题旁边的胶囊按钮
desc String N - 标题下方的描述文本内容
has-top-border Boolean N false 是否显示上边
has-bottom-border Boolean N false 是否显示下边
has-sub-top-border Boolean N false 是否显示上内边
has-sub-bottom-border Boolean N true 是否显示下内边

# Events

事件名称 说明 回调参数
dofCheckBoxListChecked 多选列表选项点击事件 e, 参数e返回已选项value信息为{ checkedList }
点我扫二维码 查看demo
Last Updated: 11/29/2023, 6:17:42 PM