This commit is contained in:
jxxghp
2024-01-05 20:40:44 +08:00
parent 11e82582b8
commit 9b753a8f5b
4 changed files with 18 additions and 12 deletions

View File

@@ -34,9 +34,10 @@ function goPlay() {
v-bind="hover.props"
:height="props.height"
:width="props.width"
class="shadow ring-gray-500 ring-1"
class="ring-gray-500"
:class="{
'transition transform-cpu duration-300 scale-105 shadow-lg': hover.isHovering,
'ring-1': imageLoaded,
}"
@click="goPlay"
>
@@ -58,7 +59,7 @@ function goPlay() {
<h1 class="mb-1 text-white font-extrabold text-xl line-clamp-2 overflow-hidden text-ellipsis ...">
{{ props.media?.title }}
</h1>
<span class="font-bold">{{ props.media?.subtitle }}</span>
<span>{{ props.media?.subtitle }}</span>
</VCardText>
</VImg>
</template>

View File

@@ -16,6 +16,11 @@ function imageLoadHandler() {
imageLoaded.value = true
}
// 计算图片地址
const getImgUrl = computed(() => {
return props.media?.image || props.media?.image_list?.[0]
})
// 跳转播放
function goPlay() {
if (props.media?.link)
@@ -41,7 +46,7 @@ function goPlay() {
>
<template #image>
<VImg
:src="props.media?.image"
:src="getImgUrl"
aspect-ratio="2/3"
cover
@load="imageLoadHandler"

View File

@@ -30,15 +30,15 @@ const dialog = ref(false)
// 从localStorage中获取数据
const default_config = {
mediaStatistic: true,
scheduler: true,
speed: true,
scheduler: false,
speed: false,
storage: true,
weeklyOverview: true,
cpu: true,
memory: true,
library: false,
playing: false,
latest: false,
weeklyOverview: false,
cpu: false,
memory: false,
library: true,
playing: true,
latest: true,
}
const config = ref(JSON.parse(localStorage.getItem('MP_DASHBOARD') || '{}'))
if (Object.keys(config.value).length === 0) {