fatihsolhan / v-onboarding

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

feat: finish by exit and show/hide exit button #73

Closed rozsazoltan closed 1 year ago

rozsazoltan commented 1 year ago

Initial concept: https://github.com/fatihsolhan/v-onboarding/issues/72#issuecomment-1541918704

image X --> exit

Now

When we click on the exit button, we need to implement the necessary code to hide the overlay, but the exit button automatically appears. I have come up with two possible solutions that can be applied separately, so I have implemented both of them.




1.) (Auto) Finish By Exit

When we click on the exit button, with the help of a setting, we can easily specify whether we want the step sequence to be completed or not, but the option to inject our own script remains available through the @exit emit. (If we set the autoFinish to false, we still have the option to run the finish (with @exit emit using), so I found it appropriate to include the 'auto' prefix.)

Default

options.autoFinishByExit: true

Usage

const options = {
    autoFinishByExit: false // here
}
<VOnboardingWrapper 
    ref="wrapper"
    :options="options" <!-- required -->
    :steps="onboardingSteps" 
 />




2.) Hide Exit Button

We provide the option to hide the exit button, similar to the prev and next buttons.

Default

options.hideButtons.exit: false

Usage

const options = {
    hideButtons: {
        exit: true // here
    },
}
<VOnboardingWrapper 
    ref="wrapper"
    :options="options" <!-- required -->
    :steps="onboardingSteps" 
 />
netlify[bot] commented 1 year ago

Deploy Preview for eloquent-lamport-f2ffa1 canceled.

Name Link
Latest commit 73efe59a48df095d0e80fd1b7ad93d63a912062d
Latest deploy log https://app.netlify.com/sites/eloquent-lamport-f2ffa1/deploys/64610b42b06c48000837bd04
netlify[bot] commented 1 year ago

Deploy Preview for beamish-dango-bc9c2d canceled.

Name Link
Latest commit 73efe59a48df095d0e80fd1b7ad93d63a912062d
Latest deploy log https://app.netlify.com/sites/beamish-dango-bc9c2d/deploys/64610b42ebf6b500088ec407
fatihsolhan commented 1 year ago

Hey @rozsazoltan,

Just took a look at your PR. Great stuff! Love the new features you've added. Your code and approach are on point, and the updates to the docs are much appreciated.

I'm all set to merge this in. Thanks for the cool work!

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 2.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: