This commit is contained in:
lcw
2025-12-17 16:27:59 +08:00
parent cd06aaf1be
commit 6a80bddff3
8 changed files with 144 additions and 21269 deletions

View File

@ -1,6 +1,6 @@
<template>
<div class="form-item-box" :style="{ width: width }">
<el-checkbox-group v-model="modelValue" @change="handleCheckAllChange">
<el-checkbox-group :model-value="localValue" @change="handleCheckAllChange">
<el-checkbox
v-for="item in checkList"
:key="item.value"
@ -34,15 +34,21 @@ const props = defineProps({
type: String
}
});
const localValue = ref(props.modelValue);
watch(
() => props.modelValue,
(val) => {
localValue.value = val;
console.log(val, "val");
},
{ deep: true }
);
const emits = defineEmits(["update:modelValue"]);
const handleCheckAllChange = (e) => {
localValue.value = e;
emits("update:modelValue", e);
};
</script>