mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-31 05:10:45 +08:00
- Added ScrollToTopBtn component for smooth scrolling to the top of the page. - Registered ScrollToTopBtn in main.ts. - Integrated ScrollToTopBtn into browse.vue, discover.vue, recommend.vue, resource.vue pages. - Updated components.d.ts to include ScrollToTopBtn type definition. - Refactored MediaCard.vue and SlideView.vue for improved hover effects and styling. - Cleaned up unused styles and optimized existing styles for better performance and readability.
45 lines
1.3 KiB
Vue
45 lines
1.3 KiB
Vue
<script setup lang="ts">
|
|
import MediaCardListView from '@/views/discover/MediaCardListView.vue'
|
|
import PersonCardListView from '@/views/discover/PersonCardListView.vue'
|
|
|
|
// 输入参数
|
|
const props = defineProps({
|
|
// API路径
|
|
paths: Array as PropType<string[]> | PropType<string>,
|
|
})
|
|
|
|
// 路由参数
|
|
const route = useRoute()
|
|
|
|
// 标题
|
|
let title = route.query?.title?.toString()
|
|
|
|
// 类型
|
|
const type = route.query?.type?.toString()
|
|
if (type === 'person') title = '演员:' + title
|
|
|
|
// 计算API路径
|
|
function getApiPath(paths: string[] | string) {
|
|
if (Array.isArray(paths)) return paths.join('/')
|
|
else return paths
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<div v-if="title" class="my-3 md:flex md:items-center md:justify-between">
|
|
<div class="min-w-0 flex-1 mx-0">
|
|
<h2
|
|
class="ms-1 truncate text-2xl font-bold leading-7 text-gray-100 sm:overflow-visible sm:text-3xl sm:leading-9 md:mb-0"
|
|
data-testid="page-header"
|
|
>
|
|
<span class="text-moviepilot">{{ title }}</span>
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
<PersonCardListView v-if="type === 'person'" :apipath="getApiPath(props.paths || '')" :params="route.query" />
|
|
<MediaCardListView v-else :apipath="getApiPath(props.paths || '')" :params="route.query" />
|
|
<VScrollToTopBtn />
|
|
</div>
|
|
</template>
|