mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-18 23:47:35 +08:00
40 lines
992 B
Vue
40 lines
992 B
Vue
<script setup lang="ts">
|
|
import MediaCardListView from '@/views/discover/MediaCardListView.vue'
|
|
|
|
// 输入参数
|
|
const props = defineProps({
|
|
// API路径
|
|
paths: Array as PropType<string[]> | PropType<string>,
|
|
})
|
|
|
|
// 路由参数
|
|
const route = useRoute()
|
|
|
|
// 标题
|
|
const title = route.query?.title?.toString()
|
|
|
|
// 计算API路径
|
|
function getApiPath(paths: string[] | string) {
|
|
if (Array.isArray(paths))
|
|
return paths.join('/')
|
|
else
|
|
return paths
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<div v-if="title" class="mt-3 md:flex md:items-center md:justify-between">
|
|
<div class="min-w-0 flex-1 mx-0">
|
|
<h2 class="mb-4 truncate text-2xl font-bold leading-7 text-gray-100 sm:overflow-visible sm:text-4xl sm:leading-9 md:mb-0" data-testid="page-header">
|
|
<span class="text-moviepilot">{{ title }}</span>
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
<MediaCardListView
|
|
:apipath="getApiPath(props.paths || '')"
|
|
:params="route.query"
|
|
/>
|
|
</div>
|
|
</template>
|