File tree 3 files changed +18
-4
lines changed
3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 15
15
16
16
<slot name =" actions" >
17
17
<div class =" v-step__buttons" >
18
- <button @click.prevent =" stop" v-if =" !isLast" class =" v-step__button" >{{ labels.buttonSkip }}</button >
19
- <button @click.prevent =" previousStep" v-if =" !isFirst" class =" v-step__button" >{{ labels.buttonPrevious }}</button >
20
- <button @click.prevent =" nextStep" v-if =" !isLast" class =" v-step__button" >{{ labels.buttonNext }}</button >
21
- <button @click.prevent =" stop" v-if =" isLast" class =" v-step__button" >{{ labels.buttonStop }}</button >
18
+ <button @click.prevent =" stop" v-if =" !isLast && checkEnabledButtons('buttonSkip') " class =" v-step__button" >{{ labels.buttonSkip }}</button >
19
+ <button @click.prevent =" previousStep" v-if =" !isFirst && checkEnabledButtons('buttonPrevious') " class =" v-step__button" >{{ labels.buttonPrevious }}</button >
20
+ <button @click.prevent =" nextStep" v-if =" !isLast && checkEnabledButtons('buttonNext') " class =" v-step__button" >{{ labels.buttonNext }}</button >
21
+ <button @click.prevent =" stop" v-if =" isLast && checkEnabledButtons('buttonStop') " class =" v-step__button" >{{ labels.buttonStop }}</button >
22
22
</div >
23
23
</slot >
24
24
@@ -55,6 +55,9 @@ export default {
55
55
},
56
56
labels: {
57
57
type: Object
58
+ },
59
+ enabledButtons: {
60
+ type: Object
58
61
}
59
62
},
60
63
data () {
@@ -104,6 +107,9 @@ export default {
104
107
console .error (' [Vue Tour] The target element ' + this .step .target + ' of .v-step[id="' + this .hash + ' "] does not exist!' )
105
108
this .$emit (' targetNotFound' , this .step )
106
109
}
110
+ },
111
+ checkEnabledButtons (name ) {
112
+ return this .enabledButtons .hasOwnProperty (name) ? this .enabledButtons [name] : true
107
113
}
108
114
},
109
115
mounted () {
Original file line number Diff line number Diff line change 9
9
:is-first =" isFirst"
10
10
:is-last =" isLast"
11
11
:labels =" customOptions.labels"
12
+ :enabled-buttons =" customOptions.enabledButtons"
12
13
>
13
14
<!-- Default slot {{ currentStep }}-->
14
15
<v-step
22
23
:is-first =" isFirst"
23
24
:is-last =" isLast"
24
25
:labels =" customOptions.labels"
26
+ :enabled-buttons =" customOptions.enabledButtons"
25
27
>
26
28
<!-- <div v-if="index === 2" slot="actions">
27
29
<a @click="nextStep">Next step</a>
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ export const DEFAULT_OPTIONS = {
13
13
buttonPrevious : 'Previous' ,
14
14
buttonNext : 'Next' ,
15
15
buttonStop : 'Finish'
16
+ } ,
17
+ enabledButtons : {
18
+ buttonSkip : true ,
19
+ buttonPrevious : true ,
20
+ buttonNext : true ,
21
+ buttonStop : true
16
22
}
17
23
}
18
24
You can’t perform that action at this time.
0 commit comments