mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-07-08 07:51:37 +08:00
add person route
This commit is contained in:
@@ -13,6 +13,9 @@ const route = useRoute()
|
||||
// 标题
|
||||
const title = route.query?.title?.toString()
|
||||
|
||||
// 副标题
|
||||
const subtitle = route.query?.subtitle?.toString()
|
||||
|
||||
// 计算API路径
|
||||
function getApiPath(paths: string[] | string) {
|
||||
if (Array.isArray(paths))
|
||||
@@ -28,6 +31,7 @@ function getApiPath(paths: string[] | string) {
|
||||
<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>
|
||||
<span class="text-sm">{{ subtitle }}</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
43
src/pages/person.vue
Normal file
43
src/pages/person.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<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()
|
||||
|
||||
// 副标题
|
||||
const subtitle = route.query?.subtitle?.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-8 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>
|
||||
<span class="text-sm">{{ subtitle }}</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<MediaCardListView
|
||||
:apipath="getApiPath(props.paths || '')"
|
||||
:params="route.query"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user