| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <template>
- <view class="pic-comp-container">
- <image
- class="pic-comp-image"
- :src="src"
- mode="aspectFill"
- @click="handleClick"
- />
- </view>
- </template>
- <script>
- export default {
- name: 'PicComp',
- props: {
- src: {
- type: String,
- default: ''
- }
- },
- methods: {
- handleClick() {
- this.$emit('needPreviewPic', this.src)
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .pic-comp-container {
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- overflow: hidden;
- border-radius: 30rpx;
- }
- .pic-comp-image {
- width: 100% !important;
- height: 100% !important;
- object-fit: cover;
- }
- </style>
|