> For the complete documentation index, see [llms.txt](https://vuxjs.gitbook.io/vux/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vuxjs.gitbook.io/vux/biao-dan-zu-jian/checklist-duo-xuan.md).

# checklist 多选

## Props

| 参数           | 说明          | 类型      | 默认值   |
| ------------ | ----------- | ------- | ----- |
| title        | 选项标题        | String  | 无     |
| required     | 可选，是否为必选项   | Boolean | true  |
| options      | 选项数组        | Array   | 无     |
| value        | 可选，已选择条目值   | Array   | 无     |
| max          | 可选，至多选择条目个数 | Number  | 无     |
| min          | 可选，至少选择条目个数 | Number  | 无     |
| random-order | 可选，是否打乱条目排序 | Boolean | false |

> 当设置`required=false`时，`min`设置将无效，即最少选定个数为0

## Demo

### 基本使用

\`\`\` vux height=240 components=Checklist

&#x20;\</template>

\
export default {\
&#x20; data () {\
&#x20;     return {\
&#x20;         hobbies: \['篮球', '足球', '羽毛球', '打飞机'],\
&#x20;         hobby: \['打飞机']\
&#x20;     }\
&#x20; },\
&#x20; methods: {\
&#x20;     change (val) {\
&#x20;         console.log('change', val)\
&#x20;     }\
&#x20; }\
}\
&#x20;\`\`\` ### 设定选择条目个数 \`\`\` vux height=250 components=Checklist\
export default {\
&#x20; data () {\
&#x20;   return {\
&#x20;     items: \['篮球', '足球', '羽毛球', '台球'],\
&#x20;     selectedItems: \[]\
&#x20;   }\
&#x20; },\
&#x20; methods: {\
&#x20;   change (val) {\
&#x20;     console.log("change", val)\
&#x20;   }\
&#x20; }\
}<br>

````
### key-value类型数组展示

> 每个条目的`key`必须为字符串

``` vux height=200 components=Checklist

<template>
<checklist title="Please select" :options="objectList" :value.sync="objectListValue"></checklist>
</template>
<script>
export default {
    data () {
        return {
            objectList: [{key: '1', value: '001 value'}, {key: '2', value: '002 value'}, {key: '3', value: '003 value'}],
            objectListValue: ['1', '2']
        }
    }
}
</script>
````

### 打乱展示顺序

\`\`\` vux height=250 components=Checklist

&#x20;\</template>

\
export default {\
&#x20; data () {\
&#x20;   return {\
&#x20;     items: \['篮球', '足球', '羽毛球', '台球'],\
&#x20;     selectedItems: \[]\
&#x20;   }\
&#x20; }\
}<br>

\`\`\`
