diff --git a/src/components/People.vue b/src/components/People.vue
index 1237689..badaa49 100644
--- a/src/components/People.vue
+++ b/src/components/People.vue
@@ -33,17 +33,25 @@
-
+
別名:
- {{ data.info.also_known_as?.join('、') }}
+ {{
+ data.info.also_known_as?.slice(0, 10).join('、')
+ }}
-
+
生日:
- {{ data.info.birthday }}
+ {{ data.info.birthday || '-' }}
({{ getAge() }}歲)
@@ -52,10 +60,10 @@
-
+
-
+
@@ -72,11 +80,11 @@
{
let tmp = Object.keys(allByYear.value)
.sort((a, b) => b - a)
.filter(e => e !== '-')
- tmp.unshift('-')
+ tmp.includes('-') && tmp.unshift('-')
return tmp
})
@@ -182,6 +190,7 @@ async function getPeopleInfo() {
}
// https://www.imdb.com/name/nm8784654/ imdb
function getAge() {
+ if (!data.info.birthday) return '?'
return new Date().getFullYear() - new Date(data.info.birthday).getFullYear()
}
@@ -206,7 +215,6 @@ onBeforeMount(() => {
::v-deep .poster {
&__bottom {
@apply h-1/3;
-
}
}
diff --git a/src/components/common/FilmList.vue b/src/components/common/FilmList.vue
index b03f970..70cf9f0 100644
--- a/src/components/common/FilmList.vue
+++ b/src/components/common/FilmList.vue
@@ -18,8 +18,8 @@
- {{ item.name }}
-
+ {{ item.name }}
+
{{ item.vote_average.toFixed(1) }}
@@ -43,8 +43,8 @@ const props = defineProps({
},
type: {
type: String,
- default: 'movie'
- }
+ default: 'movie',
+ },
})
const formatData = computed(() => {
return props.data.map(e => {
@@ -54,5 +54,19 @@ const formatData = computed(() => {
}
})
})
+
-
\ No newline at end of file
+