Skip to content

Commit

Permalink
修复翻页按钮栏切页按钮只显示前几页的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed May 15, 2024
1 parent 4ac6768 commit d16babe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions publish/changeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- 修复与优化繁体中文、英语翻译显示(#1845
- 修复歌曲时文件名过长导致歌曲无法下载的问题(#1877
- 修复文本提示气泡在内容过长时,文本未被换行而被截断的问题
- 修复翻页按钮栏切页按钮只显示前几页的问题

### 变更

Expand Down
10 changes: 5 additions & 5 deletions src/renderer/components/material/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down

0 comments on commit d16babe

Please sign in to comment.