image-show.vue 750 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view>
  3. <u-overlay :show="imageShow" @click="imageClose" :opacity="0.9">
  4. <view class="flex warp">
  5. <view class="rect" @tap.stop>
  6. <image :src="imageUrl" mode="scaleToFill"></image>
  7. </view>
  8. </view>
  9. </u-overlay>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name: "image-show",
  15. props: {
  16. imageShow: {
  17. type: [Boolean],
  18. default: false
  19. },
  20. imageUrl: {
  21. type: [String, Number],
  22. default: ''
  23. }
  24. },
  25. data() {
  26. return {
  27. };
  28. },
  29. methods:{
  30. imageClose(){
  31. this.$emit('close')
  32. },
  33. }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. .warp {
  38. width: 100%;
  39. height: 100%;
  40. }
  41. .rect {
  42. width: 100%;
  43. max-height: 700rpx;
  44. background-color: #fff;
  45. }
  46. image{
  47. width: 100%;
  48. }
  49. </style>