<template>
<div style="border-bottom: 1px solid #e9e9e9;padding-bottom:6px;margin-bottom:6px;">
<Checkbox
:indeterminate="indeterminate"
:value="checkAll"
**@click.prevent.native="handleCheckAll"**>全选</Checkbox>
</div>
<CheckboxGroup v-model="checkAllGroup" @on-change="checkAllGroupChange">
<Checkbox label="香蕉"></Checkbox>
<Checkbox label="苹果"></Checkbox>
<Checkbox label="西瓜"></Checkbox>
</CheckboxGroup>
</template>
<script>
export default {
data () {
return {
indeterminate: true,
checkAll: false,
checkAllGroup: ['香蕉', '西瓜']
}
},
methods: {
handleCheckAll () {
if (this.indeterminate) {
this.checkAll = false;
} else {
this
详解iview的checkbox多选框全选时校验问题
最新推荐文章于 2024-07-19 17:02:07 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)