1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <div class="img-wrapper">
- <img :src="imgSrc || defaultImgSrc" alt="">
- <div v-if="imgSrc" class="cancel-btn-background" @click="$emit('cancel')">
- <i class="iconfont icon-pop-ups_shut-down"></i>
- </div>
- </div>
- </template>
- <script>
- export default {
- props: {
- imgSrc: {
- type: String,
- default: '',
- },
- defaultImgSrc: {
- type: String,
- require: true,
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .img-wrapper {
- flex: 0 0 auto;
- position: relative;
- width: 136px;
- height: 136px;
- margin-right: 16px;
- background: #1A1B1D;
- border-radius: 4px;
- border: 1px solid #404040;
- overflow: hidden;
- > img {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- > .cancel-btn-background {
- width: 52px;
- height: 52px;
- position: absolute;
- top: -28px;
- right: -28px;
- background: rgba(0, 0, 0, 0.5);
- border-radius: 50%;
- cursor: pointer;
- &:hover {
- color: #FA5555;
- }
- > i {
- font-size: 12px;
- transform: scale(0.8);
- position: absolute;
- left: 9px;
- bottom: 9px;
- }
- }
- }
- </style>
|