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

Commit 343daf1

Browse files
committed
Add name for WizardStep
1 parent 8351c62 commit 343daf1

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

dev-example/WizardRoute.vue

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,14 @@
55
<button @click="tabs.unshift('new start')">Add one at start</button>
66
<router-link to="/test">Go to a different route</router-link>
77
<form-wizard @on-complete="onComplete"
8-
shape="circle"
8+
@on-change="handleChange"
9+
:start-index.sync="activeIndex"
10+
shape="tab"
911
color="#e74c3c">
10-
<tab-content title="Personal details"
11-
route="/first"
12-
icon="ti-user">
13-
</tab-content>
14-
<tab-content title="Additional Info"
15-
route="/second"
16-
icon="ti-settings">
17-
</tab-content>
18-
<tab-content title="Last step"
19-
route="/third"
20-
icon="ti-check">
21-
</tab-content>
22-
<transition name="fade" mode="out-in">
23-
<router-view></router-view>
24-
</transition>
25-
12+
<tab-content v-for="tab in tabs" :title="tab" :key="tab">{{tab}}</tab-content>
13+
<transition name="fade" mode="out-in">
14+
<router-view></router-view>
15+
</transition>
2616
</form-wizard>
2717
</div>
2818
</template>
@@ -36,7 +26,8 @@
3626
loadingWizard: false,
3727
error: null,
3828
count: 0,
39-
tabs: ['test', 'test2', 'test3']
29+
tabs: ['test', 'test2', 'test3'],
30+
activeIndex: 0
4031
}
4132
},
4233
methods: {
@@ -46,6 +37,9 @@
4637
setLoading (value) {
4738
this.loadingWizard = value
4839
},
40+
handleChange(prevIndex, nextIndex){
41+
console.log(`Changing from ${prevIndex} to ${nextIndex}`)
42+
},
4943
setError (error) {
5044
this.error = error
5145
},

src/components/WizardStep.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
</template>
3535
<script>
3636
export default {
37+
name: 'wizard-step',
3738
props: {
3839
tab: {
3940
type: Object,

0 commit comments

Comments
 (0)