You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: docs/README.md
+23-10Lines changed: 23 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,12 +148,32 @@ Vue-form-wizard emits certain events when certain actions happen inside the comp
148
148
***prev** - Previous button content (no need to worry about handling the button functionality)
149
149
***next** - Next button content
150
150
***finish** - Finish button content
151
+
***custom-buttons-left** - Appears on right of "Back" button
152
+
***custom-buttons-right** - Appears on the left of "Next/Finish" button
151
153
152
154
## Scoped slots
153
-
Form-wizard exposes 2 scoped slots which can be used to customize some parts of the wizard. Usage example and implementation details are presented in [0.6.2 release](https://github.com/cristijora/vue-form-wizard/releases/tag/v0.6.2)
155
+
156
+
Form-wizard exposes multiple scoped slots which can be used to customize some parts of the wizard. Usage example and implementation details are presented in [0.6.2 release](https://github.com/cristijora/vue-form-wizard/releases/tag/v0.6.2)
157
+
Since [0.6.3](https://github.com/cristijora/vue-form-wizard/releases/tag/v0.6.3), button slots can be also used as scoped slots and have the following methods/properties exposed
158
+
159
+
***prev** - Previous button content (no need to worry about handling the button functionality)
160
+
***next** - Next button content
161
+
***finish** - Finish button content
162
+
***custom-buttons-left** - Appears on right of "Back" button
163
+
***custom-buttons-right** - Appears on the left of "Next/Finish" button
164
+
165
+
- nextTab // will go to the next tab/step when called
166
+
- prevTab //will got to the prev tab/step when called
167
+
- activeTabIndex // current active tab index
168
+
- isLastStep // boolean to tell whether it's the last step or not
169
+
- fillButtonStyle // object with styles for wizard-buttons (contains background and color passed through wizard props)
170
+
171
+
These properties apply to the following slots: prev, next, finish ,custom-buttons-left, custom-buttons-right, footer
154
172
155
173
### Footer slot
156
-
Has the buttons (back, next, finish) as default. When using this slot, those buttons are replaced with the content of your slot. You can achieve the same default functionallity and event tweak it with the help of the exposed methods/properties from `props`
174
+
The footer slot would be usually used to replace the whole content of your footer. By default it contains the wizard buttons (back, next, finish). When using this slot, those buttons are replaced with the content of your slot. You can achieve the same default functionallity and event tweak it with the help of the exposed methods/properties from `props`
175
+
Note that using this slot, means that you have to handle some of the wizard logic through the exposed methods/properties defined above and your template might get more verbose. If you need very fine customizations and more control over the wizard button actions
176
+
then you could use this slot. Otherwise, you could stick with the buttons slots.
157
177
One potential usage can be that you want to have a different button when completing the wizard. Maybe you want to position it in the center, give it a different color and click event
158
178
```html
159
179
<templateslot="footer"scope="props">
@@ -170,13 +190,6 @@ One potential usage can be that you want to have a different button when complet
170
190
This is just one example. You can add more buttons, hide or display conditionally based on the exposed properties.
171
191
Working fiddle for the [example above](https://jsfiddle.net/bt5dhqtf/717/)
172
192
173
-
#### Exposed props for `footer` slot:
174
-
- nextTab // will go to the next tab/step when called
175
-
- prevTab //will got to the prev tab/step when called
176
-
- activeTabIndex // current active tab index
177
-
- isLastStep // boolean to tell whether it's the last step or not
178
-
- fillButtonStyle // object with styles for wizard-buttons (contains background and color passed through wizard props)
179
-
180
193
### Step slot
181
194
This slot can be used to disable the click event on the step or to customize the UI of each step
182
195
One possible usage:
@@ -189,7 +202,7 @@ One possible usage:
189
202
</template>
190
203
```
191
204
#### Exposed props for the `step` slot
192
-
- tab (the tab object which contains the tab-content component corresponding to the step) This object contains several fields such as `active, checked, shape, color` and so on. You can check how these are used [here](https://github.com/cristijora/vue-form-wizard/blob/master/src/components/WizardStep.vue):
205
+
- tab (the tab object which contains the tab-content component corresponding to the step) This object contains several fields such as `active, checked, shape, color` and so on. You can check how these are used [here](https://github.com/cristijora/vue-form-wizard/blob/master/src/components/WizardStep.vue):
193
206
- index (The index of the step)
194
207
- transition (Transition prop passed from form-wizard)
0 commit comments