| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <template>
- <view class="pic-comp-container">
- <image class="picComp" :src="src" mode="aspectFill" @click="click"></image>
- <view class="delete-btn" @click="handleDelete">×</view>
- </view>
- </template>
- <script>
- export default {
- props: {
- src: {
- type: String,
- default: ''
- }
- },
- methods: {
- click() {
- this.$emit('needPreviewPic', this.src)
- },
- handleDelete() {
- this.$emit('delete')
- }
- }
- }
- </script>
- <style scoped>
- .pic-comp-container {
- width: 200rpx;
- height: 200rpx;
- box-sizing: border-box;
- /* overflow: hidden; */
- position: relative;
- }
- .picComp {
- width: 200rpx !important;
- height: 200rpx !important;
- object-fit: cover;
- border-radius: 30rpx;
- }
- .delete-btn {
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- text-align: center;
- background: #ff4757;
- color: #fff;
- border-radius: 50%;
- position: absolute;
- top: -10rpx;
- right: -20rpx;
- }
- </style>
|