lcw
This commit is contained in:
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user