Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
用background替代img,防止图片变形
  • Loading branch information
马云海 mayunhai () committed Jun 6, 2019
commit e6bd49b665a109f1cba5bde848d28a851e77d765
6 changes: 4 additions & 2 deletions src/components/PanThumb/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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;
Expand Down