mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Swipe): incorrect active tab when activated #7772
This commit is contained in:
parent
fc55822b48
commit
0f06cb2303
@ -3,6 +3,8 @@ import {
|
|||||||
watch,
|
watch,
|
||||||
reactive,
|
reactive,
|
||||||
computed,
|
computed,
|
||||||
|
onMounted,
|
||||||
|
onActivated,
|
||||||
onDeactivated,
|
onDeactivated,
|
||||||
onBeforeUnmount,
|
onBeforeUnmount,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
@ -17,7 +19,6 @@ import {
|
|||||||
useChildren,
|
useChildren,
|
||||||
useWindowSize,
|
useWindowSize,
|
||||||
usePageVisibility,
|
usePageVisibility,
|
||||||
onMountedOrActivated,
|
|
||||||
} from '@vant/use';
|
} from '@vant/use';
|
||||||
import { useTouch } from '../composables/use-touch';
|
import { useTouch } from '../composables/use-touch';
|
||||||
import { useExpose } from '../composables/use-expose';
|
import { useExpose } from '../composables/use-expose';
|
||||||
@ -397,9 +398,12 @@ export default createComponent({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(initialize);
|
||||||
|
onActivated(() => {
|
||||||
|
initialize(state.active);
|
||||||
|
});
|
||||||
onDeactivated(stopAutoplay);
|
onDeactivated(stopAutoplay);
|
||||||
onBeforeUnmount(stopAutoplay);
|
onBeforeUnmount(stopAutoplay);
|
||||||
onMountedOrActivated(initialize);
|
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<div ref={root} class={bem()}>
|
<div ref={root} class={bem()}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user