mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
fix: 翻页提示加入节流(#51)
This commit is contained in:
parent
89bd3eb076
commit
8977ab0440
@ -169,6 +169,10 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
onUnmounted(closeAutoPlay)
|
onUnmounted(closeAutoPlay)
|
||||||
|
|
||||||
|
const massageThrottle = throttle(function(info) {
|
||||||
|
message.success(info)
|
||||||
|
}, 3000, { leading: true, trailing: false })
|
||||||
|
|
||||||
// 向上/向下播放
|
// 向上/向下播放
|
||||||
// 遇到元素动画时,优先执行动画播放,无动画则执行翻页
|
// 遇到元素动画时,优先执行动画播放,无动画则执行翻页
|
||||||
// 向上播放遇到动画时,仅撤销到动画执行前的状态,不需要反向播放动画
|
// 向上播放遇到动画时,仅撤销到动画执行前的状态,不需要反向播放动画
|
||||||
@ -182,7 +186,7 @@ export default defineComponent({
|
|||||||
animationIndex.value = lastIndex
|
animationIndex.value = lastIndex
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message.success('已经是第一页了')
|
massageThrottle('已经是第一页了')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const execNext = () => {
|
const execNext = () => {
|
||||||
@ -194,7 +198,7 @@ export default defineComponent({
|
|||||||
animationIndex.value = 0
|
animationIndex.value = 0
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message.success('已经是最后一页了')
|
massageThrottle('已经是最后一页了')
|
||||||
closeAutoPlay()
|
closeAutoPlay()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user