fix stretchPoster

This commit is contained in:
Gauthier Roebroeck 2026-01-15 15:52:10 +08:00
parent e52803c0b5
commit 34ef05e101
2 changed files with 10 additions and 10 deletions

View file

@ -14,8 +14,8 @@
@click="isPreSelect || selected ? emit('selection', !selected) : {}"
>
<v-img
:contain="!stretchPoster"
:position="stretchPoster ? 'top' : undefined"
:cover="stretchPoster"
:position="stretchPoster ? 'top ' : undefined"
:src="posterUrl"
lazy-src="@/assets/cover.svg"
aspect-ratio="0.7071"
@ -146,7 +146,7 @@ function onCardLongPress() {
}
const {
stretchPoster = false,
stretchPoster = true,
width = 150,
disableSelection = false,
selected = false,
@ -161,12 +161,6 @@ const {
* Poster URL.
*/
posterUrl?: string
/**
* Whether to stretch the poster or not. If `false`, the image will have the `contain` property.
*
* Defaults to `true`.
*/
stretchPoster?: boolean
/**
* Card title. Displayed under the poster.
*/

View file

@ -4,7 +4,7 @@ export type ItemCardProps = {
*
* Defaults to `150`.
*/
width?: string | number
width?: number
/**
* Disable card selection.
*/
@ -17,6 +17,12 @@ export type ItemCardProps = {
* State where the selection checkbox is shown, for instance when other items in the group have been selected already.
*/
preSelect?: boolean
/**
* Whether to stretch the poster or not. If `false`, the image will have the `contain` property.
*
* Defaults to `true`.
*/
stretchPoster?: boolean
}
export type ItemCardEmits = {