picComp.vue 706 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <view class="pic-comp-container">
  3. <image class="picComp" :src="src" mode="aspectFill" @click="click"></image>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. src: {
  10. type: String,
  11. default: ''
  12. }
  13. },
  14. methods: {
  15. click() {
  16. uni.previewImage({
  17. urls: [this.src],
  18. current: this.src
  19. })
  20. }
  21. }
  22. }
  23. </script>
  24. <style scoped>
  25. .pic-comp-container {
  26. width: 100%;
  27. height: 100%;
  28. box-sizing: border-box;
  29. overflow: hidden;
  30. border-radius: 30rpx;
  31. }
  32. .picComp {
  33. width: 100% !important;
  34. height: 100% !important;
  35. object-fit: cover;
  36. }
  37. </style>