@@ -19,7 +19,7 @@ export interface IVTourProps {
1919 skip: string ;
2020 };
2121 saveToLocalStorage? : ' never' | ' step' | ' end' ;
22- canSkip ? : boolean ;
22+ hideSkip ? : boolean ;
2323 hideArrow? : boolean ;
2424}
2525export interface IVTourData {
@@ -47,6 +47,7 @@ defineExpose({
4747 nextStep ,
4848 lastStep ,
4949 endTour ,
50+ stopTour ,
5051 goToStep ,
5152 resetTour
5253});
@@ -77,11 +78,18 @@ function startTour(): void{
7778 }, props .startDelay );
7879}
7980
80- function resetTour(): void {
81+ function stopTour(): void {
82+ if (props .backdrop ) document .querySelector (' #vjt-backdrop' )! .setAttribute (' data-hidden' , ' ' );
83+ if (props .highlight ) document .querySelectorAll (' .vjt-highlight' ).forEach ((element ) => element .classList .remove (' vjt-highlight' ));
84+ _Tooltip .value ! .setAttribute (' data-hidden' , ' ' );
85+ }
86+
87+ function resetTour(restart : boolean ): void {
88+ stopTour ();
8189 _CurrentStep .currentStep = 0 ;
8290 _CurrentStep .lastStep = 0 ;
8391 localStorage .removeItem (' vjt-' + (props .name || ' default' ));
84- startTour ();
92+ if ( restart ) startTour ();
8593}
8694
8795function nextStep(): void {
@@ -158,7 +166,7 @@ onMounted(() => {
158166 <slot name =" actions" v-bind =" { lastStep, nextStep, endTour, _CurrentStep, getNextLabel, props }" >
159167 <div class =" vjt-actions" >
160168 <button v-if =" _CurrentStep.lastStep < _CurrentStep.currentStep" type =" button" @click.prevent =" lastStep()" v-text =" props.buttonLabels?.back || 'Back'" ></button >
161- <button v-if =" !props.canSkip " type =" button" @click.prevent =" endTour()" v-text =" props.buttonLabels?.skip || 'Skip'" ></button >
169+ <button v-if =" !props.hideSkip " type =" button" @click.prevent =" endTour()" v-text =" props.buttonLabels?.skip || 'Skip'" ></button >
162170 <button type =" button" @click.prevent =" nextStep()" v-text =" getNextLabel" ></button >
163171 </div >
164172 </slot >
0 commit comments