feat(components): [el-image-viewer] emit close event (#3129)

This commit is contained in:
btea 2021-08-30 18:01:44 +08:00 committed by GitHub
parent 88e193ce96
commit 4e19718553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {