From 4e1971855333191a88f8e7d42e9a522345b49203 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Mon, 30 Aug 2021 18:01:44 +0800 Subject: [PATCH] feat(components): [el-image-viewer] emit close event (#3129) --- packages/components/image/src/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/image/src/index.vue b/packages/components/image/src/index.vue index 18502832a3..f266bfb8f2 100644 --- a/packages/components/image/src/index.vue +++ b/packages/components/image/src/index.vue @@ -100,7 +100,7 @@ export default defineComponent({ default: 2000, }, }, - emits: ['error', 'switch'], + emits: ['error', 'switch', 'close'], setup(props, { emit }) { const { t } = useLocaleInject() // init here @@ -261,6 +261,7 @@ export default defineComponent({ function closeViewer() { document.body.style.overflow = prevOverflow showViewer.value = false + emit('close') } function switchViewer(val) {