Skip to content

Commit

Permalink
fix(comp:tour): async appended steps doesn't work (#1866)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Mar 25, 2024
1 parent 094f62a commit 0c6c54d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions packages/components/tour/src/composables/useActiveStep.ts
Expand Up @@ -33,12 +33,11 @@ export function useActiveStep(

const getActiveStep = async (index: number) => {
const props = mergedProps.value
if (!props.steps) {
const step = props.steps?.[index]
if (!step) {
return
}

const step = props.steps[index]

if (step.beforeEnter) {
await step.beforeEnter()
}
Expand Down Expand Up @@ -117,9 +116,9 @@ export function useActiveStep(
}

watch(
activeIndex,
async current => {
if (current === activeStep.value?.index) {
[activeIndex, () => mergedProps.value.steps],
([current, steps], [, preSteps]) => {
if (current === activeStep.value?.index && steps === preSteps) {
return
}

Expand Down
2 changes: 1 addition & 1 deletion packages/components/tour/src/composables/useStepChange.ts
Expand Up @@ -76,7 +76,7 @@ export function useStepChange(
watch(
activeIndex,
(current, pre) => {
if (current !== pre) {
if (current !== pre && visible.value) {
transitionTmr && clearTimeout(transitionTmr)
lock()
}
Expand Down

0 comments on commit 0c6c54d

Please sign in to comment.