Image: Fix shortcut key not work at second time issue (#18983) (#19156)

* Image: fix shortcut key not work at second time issue (#18983)

* fix test case

* fix test case

Co-authored-by: cl199793 <cl199793@alibaba-inc.com>
pull/19162/head
luckyCao 2020-04-13 10:15:17 +08:00 committed by GitHub
parent 3235daa363
commit f3c76ee0ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -16,7 +16,7 @@
:style="imageStyle"
:class="{ 'el-image__inner--center': alignCenter, 'el-image__preview': preview }">
<template v-if="preview">
<image-viewer :z-index="zIndex" :initial-index="imageIndex" v-show="showViewer" :on-close="closeViewer" :url-list="previewSrcList"/>
<image-viewer :z-index="zIndex" :initial-index="imageIndex" v-if="showViewer" :on-close="closeViewer" :url-list="previewSrcList"/>
</template>
</div>
</template>

View File

@ -128,11 +128,10 @@ describe('Image', () => {
vm.$el.querySelector('.el-image__inner').click();
await wait();
const $wrapper = vm.$el.querySelector('.el-image-viewer__wrapper');
expect($wrapper).to.exist;
expect(vm.$el.querySelector('.el-image-viewer__wrapper')).to.exist;
vm.$el.querySelector('.el-image-viewer__close').click();
await wait(1000);
expect($wrapper.style.display).to.equal('none');
expect(vm.$el.querySelector('.el-image-viewer__wrapper')).to.not.exist;
});
});