Use a computed property instead of a prop to specify the chapters layout (#3199)

This commit is contained in:
absidue 2023-02-17 02:34:21 +01:00 committed by GitHub
parent 76d867a370
commit e5cf255894
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -7,10 +7,6 @@ export default defineComponent({
'ft-card': FtCard
},
props: {
compact: {
type: Boolean,
default: false
},
chapters: {
type: Array,
required: true
@ -29,6 +25,10 @@ export default defineComponent({
computed: {
currentTitle: function () {
return this.chapters[this.currentIndex].title
},
compact: function () {
return !this.chapters[0].thumbnail
}
},
watch: {

View File

@ -122,7 +122,6 @@
/>
<watch-video-chapters
v-if="!hideChapters && !isLoading && videoChapters.length > 0"
:compact="!videoChapters[0].thumbnail"
:chapters="videoChapters"
:current-chapter-index="videoCurrentChapterIndex"
class="watchVideo"