Skip to content

Commit

Permalink
fix(ImagePreview): increase max-height
Browse files Browse the repository at this point in the history
  • Loading branch information
vvpvvp committed Jun 10, 2019
1 parent 5ec5d3e commit aed8f54
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion doc/components/demos/imagepreview/imagepreview1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
return {
datas: [
{ thumbUrl: `${link}thumb-4.jpg`, url: `${link}image-4.jpg` },
{ thumbUrl: `${link}thumb-5.jpg`, url: `${link}image-5.jpg` },
{ thumbUrl: `https://5b0988e595225.cdn.sohucs.com/images/20170905/f6a2c1dafab944d2a75b9798c8ea0f7d.png`, url: `https://5b0988e595225.cdn.sohucs.com/images/20170905/f6a2c1dafab944d2a75b9798c8ea0f7d.png` },
{ thumbUrl: `${link}thumb-6.jpg`, url: `${link}image-6.jpg` }
]
};
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/image-preview/image-preview-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export default {
initStyle(e) {
let width = this.$refs.img.width;
let height = this.$refs.img.height;
if (width > 800 || height > 800) {
let percent = Math.max(width, height) / 800;
if (width > 800 || height > 12000) {
let percent = Math.min(width / 800, height / 12000);
width = width / percent;
height = height / percent;
}
Expand Down
28 changes: 14 additions & 14 deletions themes/components/image-preview.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@
position: relative;
transition: height 0.3s, width 0.3s;

& &-index{
color: #FFF;
& &-index {
color: #fff;
text-shadow: 0px 0 10px #000;
font-size: 18px;
position: absolute;
top: 10px;
right: 20px;
z-index: 2;
}
>.h-image-preview-image {
max-width:800px;
max-height:800px;
> .h-image-preview-image {
max-width: 800px;
max-height: 12000px;
display: block;
}


.fade-enter-active, .fade-leave-active {
transition: opacity .3s;
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s;
}
.fade-enter, .fade-leave-to {
.fade-enter,
.fade-leave-to {
opacity: 0;
}

Expand All @@ -31,9 +32,9 @@
top: 0;
bottom: 0;
font-size: 40px;
color: #FFF;
color: #fff;
opacity: 0;
transition: .2s opacity;
transition: 0.2s opacity;
cursor: pointer;
width: 50%;
display: flex;
Expand Down Expand Up @@ -67,7 +68,7 @@
&:hover:before {
content: '';
position: absolute;
left: 0;
left: 0;
right: 0;
top: 0;
bottom: 0;
Expand All @@ -76,12 +77,11 @@
}
}


.h-image-preview-modal {
&.h-modal {
.h-notify-container {
min-width: 0px;
padding: 5px;
}
}
}
}

0 comments on commit aed8f54

Please sign in to comment.