Authored by hongyong.zhao

返回上个界面自动隐藏大图浏览

@@ -225,7 +225,7 @@ export default { @@ -225,7 +225,7 @@ export default {
225 this.imageUrls.push(val.replace(/{width}x{height}/, "750x")); 225 this.imageUrls.push(val.replace(/{width}x{height}/, "750x"));
226 }); 226 });
227 227
228 - this.$createImagePreview({ 228 + this.preView = this.$createImagePreview({
229 imgs: this.imageUrls, 229 imgs: this.imageUrls,
230 initialIndex: index 230 initialIndex: index
231 }).show(); 231 }).show();
@@ -291,6 +291,18 @@ export default { @@ -291,6 +291,18 @@ export default {
291 }).show(); 291 }).show();
292 }); 292 });
293 } 293 }
  294 + },
  295 + beforeDestroy() {
  296 +
  297 + if (this.preView) {
  298 + this.preView.hide && this.preView.hide()
  299 + }
  300 + },
  301 +
  302 + beforeRouteLeave(to, from, next) {
  303 + if (this.preView) {
  304 + this.preView.hide && this.preView.hide()
  305 + }
294 } 306 }
295 }; 307 };
296 </script> 308 </script>