mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
fix: 处于最后一页继续翻页会回到第一页的问题修复
This commit is contained in:
parent
476078531a
commit
0f3a63421f
@ -38,14 +38,12 @@ export default () => {
|
||||
* @param command 移动页面焦点命令:上移、下移
|
||||
*/
|
||||
const updateSlideIndex = (command: string) => {
|
||||
let targetIndex = 0
|
||||
if (command === KEYS.UP && slideIndex.value > 0) {
|
||||
targetIndex = slideIndex.value - 1
|
||||
store.commit(MutationTypes.UPDATE_SLIDE_INDEX, slideIndex.value - 1)
|
||||
}
|
||||
else if (command === KEYS.DOWN && slideIndex.value < slides.value.length - 1) {
|
||||
targetIndex = slideIndex.value + 1
|
||||
store.commit(MutationTypes.UPDATE_SLIDE_INDEX, slideIndex.value + 1)
|
||||
}
|
||||
store.commit(MutationTypes.UPDATE_SLIDE_INDEX, targetIndex)
|
||||
}
|
||||
|
||||
// 将当前页面数据加密后复制到剪贴板
|
||||
|
Loading…
x
Reference in New Issue
Block a user