fix props for SongCard

This commit is contained in:
Phan An 2022-04-19 23:34:22 +02:00
parent eb66676e74
commit 6f07f6d796
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC

View file

@ -31,14 +31,24 @@
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, toRefs } from 'vue'
import { computed, defineAsyncComponent, PropType, toRefs } from 'vue'
import { eventBus, pluralize, startDragging } from '@/utils'
import { queueStore } from '@/stores'
import { playback } from '@/services'
const LikeButton = defineAsyncComponent(() => import('@/components/song/like-button.vue'))
const props = withDefaults(defineProps<{ song: Song, topPlayCount: number }>(), { topPlayCount: 0 })
const props = defineProps({
song: {
type: Object as PropType<Song>,
required: true
},
topPlayCount: {
type: Number,
default: 0
}
})
const { song, topPlayCount } = toRefs(props)
const showPlayCount = computed(() => Boolean(topPlayCount && song.value.playCount))