# 4.10 多选列表(Checkbox List)

多选列表组件,用于展示可多选的列表项

# 基础用法

<template>
  <dof-checkbox-list :list="list" @dofCheckBoxListChecked="onChecked"></dof-checkbox-list>
</template>

<script>
export default {
  data() {
    return {
      list: [
        { title: '选项1', value: 1 },
        { title: '选项2', value: 2, checked: true }
      ]
    }
  }
}
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# Attributes

Prop Type Required Default Description
list Array N [] 列表数据;每项需要提供 title 和 value
hasBorder Boolean N false 是否显示列表项分隔线
needShowTopBorder Boolean N false 是否显示第一项顶部边框
needShowLastBottomBorder Boolean N false 当前版本未使用该属性,暂不生效

# Events

事件名 说明 回调参数
dofCheckBoxListChecked 选项点击事件 e.checkedList