mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
fix(Swipe): should stop autoplay when page is hidden
This commit is contained in:
@@ -400,7 +400,7 @@ export default createComponent({
|
|||||||
watch([windowSize.width, windowSize.height], resize);
|
watch([windowSize.width, windowSize.height], resize);
|
||||||
|
|
||||||
watch(usePageVisibility(), (visible) => {
|
watch(usePageVisibility(), (visible) => {
|
||||||
if (visible) {
|
if (visible === 'visible') {
|
||||||
autoplay();
|
autoplay();
|
||||||
} else {
|
} else {
|
||||||
stopAutoplay();
|
stopAutoplay();
|
||||||
|
Reference in New Issue
Block a user