es lint fix

This commit is contained in:
thofx
2023-07-22 16:09:07 +08:00
parent 48749b29fe
commit 018778488a
80 changed files with 3994 additions and 2981 deletions
+33 -30
View File
@@ -1,58 +1,61 @@
<script setup lang="ts">
import MediaCardListView from "@/views/discover/MediaCardListView.vue";
import MediaCardListView from '@/views/discover/MediaCardListView.vue'
// 输入参数
const props = defineProps({
type: Array as PropType<string[]> | PropType<string>,
});
})
// 路由参数
const route = useRoute();
const route = useRoute()
// 面包屑标题定义
const titles: { [key: string]: any } = {
tmdb: {
trending: "流行趋势",
movies: "热门电影",
tvs: "热门电视剧",
trending: '流行趋势',
movies: '热门电影',
tvs: '热门电视剧',
},
douban: {
movies: "最新电影",
tvs: "最新电视剧",
tv_weekly_chinese: "华语剧集榜",
tv_weekly_global: "全球剧集榜",
movie_top250: "电影TOP250",
movies: '最新电影',
tvs: '最新电视剧',
tv_weekly_chinese: '华语剧集榜',
tv_weekly_global: '全球剧集榜',
movie_top250: '电影TOP250',
},
media: {
search: "搜索",
search: '搜索',
},
};
}
// 计算API路径
const getApiPath = (types: string[] | string) => {
if (Array.isArray(types)) {
return types.join("/");
} else {
return types;
}
};
function getApiPath(types: string[] | string) {
if (Array.isArray(types))
return types.join('/')
else
return types
}
// 面包屑标题
const getTitle = (types: string[] | string, title: any = "") => {
function getTitle(types: string[] | string, title: any = '') {
if (Array.isArray(types)) {
if (title) {
return [titles[types[0]][types[1]], title];
}
return ["推荐", titles[types[0]][types[1]]];
} else {
return ["发现"];
if (title)
return [titles[types[0]][types[1]], title]
return ['推荐', titles[types[0]][types[1]]]
}
};
else {
return ['发现']
}
}
</script>
<template>
<div>
<VBreadcrumbs :items="getTitle(props.type || '', route.query?.title)"></VBreadcrumbs>
<MediaCardListView :apipath="getApiPath(props.type || '')" :params="route.query" />
<VBreadcrumbs :items="getTitle(props.type || '', route.query?.title)" />
<MediaCardListView
:apipath="getApiPath(props.type || '')"
:params="route.query"
/>
</div>
</template>