Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 204009a

Browse files
committed
#57 Update scoped slot usage in docs
Add compatibility notes
1 parent 5b766db commit 204009a

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

docs/README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ components: {
4646
</tab-content>
4747
</form-wizard>
4848
```
49+
## Compatibility
50+
51+
Vue-form-wizard works with Vue > 2.2, but the examples in the docs follow the latest Vue > 2.5 changes especially on the `slot` parts.
52+
If you use vue < 2.5.x, use `scope="props"` instead of `slot-scope="props"` for scoped slots. See [Vue 2.5 simplified scoped slots](https://gist.github.com/yyx990803/9bdff05e5468a60ced06c29c39114c6b#simplified-scoped-slots-usage)
53+
54+
4955
## Props
5056
### Form Wizard props
5157
```js
@@ -191,8 +197,8 @@ then you could use this slot. Otherwise, you could stick with the buttons slots
191197
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
192198

193199
```html
194-
<template slot="footer" scope="props">
195-
<div class=wizard-footer-left>
200+
<template slot="footer" slot-scope="props">
201+
<div class="wizard-footer-left">
196202
<wizard-button v-if="props.activeTabIndex > 0 && !props.isLastStep" :style="props.fillButtonStyle">Previous</wizard-button>
197203
</div>
198204
<div class="wizard-footer-right">
@@ -209,12 +215,13 @@ Working fiddle for the [example above](https://jsfiddle.net/bt5dhqtf/717/)
209215
This slot can be used to disable the click event on the step or to customize the UI of each step
210216
One possible usage:
211217
```html
212-
<template slot="step" scope="props">
213-
<wizard-step :tab="props.tab"
214-
:transition="props.transition"
215-
:index="props.index">
216-
</wizard-step>
217-
</template>
218+
<wizard-step
219+
slot-scope="props"
220+
slot="step"
221+
:tab="props.tab"
222+
:transition="props.transition"
223+
:index="props.index">
224+
</wizard-step>
218225
```
219226
#### Exposed props for the `step` slot
220227
- 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):
@@ -456,7 +463,7 @@ Other demos:
456463
Yuhuuu! This seems pretty damn simple
457464
</tab-content>
458465

459-
<template slot="footer" scope="props">
466+
<template slot="footer" slot-scope="props">
460467
<div class=wizard-footer-left>
461468
<wizard-button v-if="props.activeTabIndex > 0 && !props.isLastStep" @click.native="props.prevTab()" :style="props.fillButtonStyle">Previous</wizard-button>
462469
</div>

0 commit comments

Comments
 (0)