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