修复翻页按钮栏切页按钮只显示前几页的问题

pull/1989/head
lyswhut 2024-05-15 13:21:26 +08:00
parent 4ac6768b7a
commit d16babefbe
2 changed files with 6 additions and 5 deletions

View File

@ -20,6 +20,7 @@
- 修复与优化繁体中文、英语翻译显示(#1845
- 修复歌曲时文件名过长导致歌曲无法下载的问题(#1877
- 修复文本提示气泡在内容过长时,文本未被换行而被截断的问题
- 修复翻页按钮栏切页按钮只显示前几页的问题
### 变更

View File

@ -81,12 +81,12 @@ export default {
return Math.floor(props.btnLength / 2)
})
const pages = computed(() => {
if (maxPage <= props.btnLength) return Array.from({ length: maxPage }, (_, i) => i + 1)
let start = props.page - pageEvg > 1
if (maxPage.value <= props.btnLength) return Array.from({ length: maxPage.value }, (_, i) => i + 1)
let start = props.page - pageEvg.value > 1
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
? maxPage - props.page < pageEvg + 1
? maxPage - (props.btnLength - 1)
: props.page - pageEvg
? maxPage.value - props.page < pageEvg.value + 1
? maxPage.value - (props.btnLength - 1)
: props.page - pageEvg.value
: 1
return Array.from({ length: props.btnLength }, (_, i) => start + i)
})