用background替代img,防止图片变形
This commit is contained in:
parent
08e64566ce
commit
e6bd49b665
src/components/PanThumb
|
@ -5,7 +5,8 @@
|
|||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
<img :src="image" class="pan-thumb">
|
||||
<!-- eslint-disable-next-line -->
|
||||
<div :style="{backgroundImage: `url(${image})`}" class="pan-thumb"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -52,7 +53,8 @@ export default {
|
|||
.pan-thumb {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-size: 100%;
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
|
|
Loading…
Reference in New Issue