Skip to content

Commit 3d175cd

Browse files
committed
Fix(image): replace the image tag with background-image to prevent the stretching
1 parent 17d8248 commit 3d175cd

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

src/components/PanThumb/index.vue

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
<slot />
99
</div>
1010
</div>
11-
<img
12-
:src="image"
11+
<div
12+
:style="{backgroundImage: `url(${image})`}"
1313
class="pan-thumb"
14-
>
14+
/>
1515
</div>
1616
</template>
1717

@@ -113,24 +113,12 @@ export default class extends Vue {
113113
.pan-thumb {
114114
width: 100%;
115115
height: 100%;
116-
background-size: 100%;
116+
background-position: center center;
117+
background-size: cover;
117118
border-radius: 50%;
118119
overflow: hidden;
119120
position: absolute;
120121
transform-origin: 95% 40%;
121122
transition: all 0.3s ease-in-out;
122-
123-
&:after {
124-
content: '';
125-
width: 8px;
126-
height: 8px;
127-
position: absolute;
128-
border-radius: 50%;
129-
top: 40%;
130-
left: 95%;
131-
margin: -4px 0 0 -4px;
132-
background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%);
133-
box-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
134-
}
135123
}
136124
</style>

0 commit comments

Comments
 (0)