diff --git a/src/cascader/cascader.vue b/src/cascader/cascader.vue index 487804ab9..49669a186 100644 --- a/src/cascader/cascader.vue +++ b/src/cascader/cascader.vue @@ -36,7 +36,7 @@
- +
@@ -213,7 +213,7 @@ export default defineComponent({ item[keys.value?.value ?? 'value'], items.map((item, index) => toRaw(item?.[selectedIndexes[index]])), ); - hide('finish'); + close('finish'); } }; @@ -225,17 +225,17 @@ export default defineComponent({ open.value = visible.value; }); - const hide = (trigger: string) => { - visible.value = false; + const close = (trigger: string) => { emitEvent('close', { trigger }); }; - const onVisibleChange = () => { - hide('overlay'); + const onVisibleChange = (visible: boolean) => { + close('overlay'); }; const onClose = () => { - hide('close-btn'); + open.value = false; + close('close-btn'); }; const onStepClick = (index: number) => {