fatihsolhan / v-onboarding

v-onboarding is a super-slim, fully-typed onboarding component for Vue 3
https://v-onboarding.fatihsolhan.com/
MIT License
164 stars 20 forks source link

Add delay and hide / autoHide #76

Closed Farnsi closed 5 months ago

Farnsi commented 1 year ago

on.beforeStep should be executed normally, the step should only be displayed after the delay.

example

const steps = [
  {
    attachTo: { element: '#id1' },
    content: { title: 'Title 1'  },
    hide: true // defaults to true, hides the step when the next step has a delay
  },
  {
    delay: 2000,
    attachTo: { element: '#id2' },
    content: { title: 'Title 2'  },
  }

On start it shows step 1, click next, it hides the current step 1, cause step 2 has a delay. Step 2 on.beforeStep is executed (e.g. do things like open a navigation with animation). After 2000 miliseconds step 2 appears.

rozsazoltan commented 1 year ago

Yes, it would be useful to wait for the end of scrolling when creating an SVG in the case of "smooth" scrolling, but the mentioned animation is also a good example.

fatihsolhan commented 5 months ago

I suggest you to use on.beforeStep for adding delay before the step

on: {
  async beforeStep() {
    await new Promise(resolve => setTimeout(resolve, 1000))
  }
}

I'll add an option to hide the step until on.beforeStep is executed

github-actions[bot] commented 5 months ago

:tada: This issue has been resolved in version 2.7.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: