🐛(component): 修复 layer 组件 end 触发两次的问题

This commit is contained in:
就眠儀式 2022-10-08 14:51:48 +08:00
parent 8021404c34
commit c3e88cfdab
2 changed files with 13 additions and 6 deletions

View File

@ -95,10 +95,10 @@ const intOption = () => {
};
const handleRemove = (value: any) => {
if(Array.isArray(selectedValue.value)) {
selectedValue.value = selectedValue.value.filter(item => item != value);
if (Array.isArray(selectedValue.value)) {
selectedValue.value = selectedValue.value.filter((item) => item != value);
}
}
};
onMounted(() => {
intOption();

View File

@ -327,7 +327,7 @@ watch(
* 监听 visible
* <p>
*/
watch(
watch(
() => visible.value,
() => {
if (visible.value) {
@ -335,13 +335,20 @@ watch(
firstOpenDelayCalculation();
}
props.success();
} else {
props.end();
}
},
{ immediate: true }
);
watch(
() => visible.value,
() => {
if (!visible.value) {
props.end();
}
}
);
/**
* 高度监听
* <p>