Add option to control the visibility of index in title

This commit is contained in:
HoshinoKoji 2025-03-06 14:14:01 +08:00
parent d6e8ca4068
commit d1a0791d65

View File

@ -42,6 +42,7 @@ export default {
allowBack: true, allowBack: true,
allowAutoNext: true, allowAutoNext: true,
darkMode: false, darkMode: false,
showItemIndex: true,
lang: 'en-US', lang: 'en-US',
}, },
lang, lang,
@ -87,8 +88,8 @@ export default {
} }
}, },
updateTitle() { updateTitle() {
this.itemStatus.title = this.itemStatus.item ? const prefix = this.settings.showItemIndex ? `${this.currentIdx + 1}. ` : '';
`${this.currentIdx + 1}. ${this.itemStatus.item.title}` : ''; this.itemStatus.title = this.itemStatus.item ? `${prefix}${this.itemStatus.item.title}` : '';
}, },
updateItem() { updateItem() {
this.itemStatus.item = this.items[this.currentIdx]; this.itemStatus.item = this.items[this.currentIdx];