<a-checkbox-group v-model:value="checkedList" :options="plainOptions" @change="achange" />
const checkedList = ref([]);
const plainOptions = ref([]);
function getqrcodeArr() {
plainOptions.value= props.array.map((item) => {
checkedList.value.push(item.value);
return { ...item};
});
console.log(plainOptions.value);
console.log(checkedList.value,"checkedList");
}
const achange=(e)=>{
console.log("0",e);
plainOptions.value = e
console.log(checkedList.value,"checkedList");
}
checkedList.value.push(item.value);
注意这一行是默认全选的关键 不可以通过checkedList.value=PlainOptions.value来赋值
无效