2
0
mirror of https://github.com/tenrok/vue-form-wizard.git synced 2026-06-07 09:02:24 +03:00

#18 Handle dynamic tab updates

This commit is contained in:
cristijora
2017-06-07 22:30:14 +03:00
parent 4c7787eca7
commit 2f8dc613a5
3 changed files with 92 additions and 64 deletions
+6 -16
View File
@@ -1,5 +1,7 @@
<template>
<div>
<button @click="tabs.shift()">Remove one tab</button>
<button @click="tabs.push('testt')">Add one tab</button>
<form-wizard @on-complete="onComplete"
:hide-buttons="false"
shape="square"
@@ -7,22 +9,9 @@
@on-loading="setLoading"
@on-error="setError"
class="card" ref="wizard">
<tab-content title="Personal details"
route="/first"
icon="ti-user">
<tab-content v-for="tab in tabs" :title="tab" :key="tab" icon="ti-settings">
{{tab}}
</tab-content>
<tab-content title="Additional Info"
:before-change="validateAsync"
route="/second"
icon="ti-settings">
</tab-content>
<tab-content title="Last step"
route="/third"
icon="ti-check">
</tab-content>
<transition name="fade" mode="out-in">
<router-view></router-view>
</transition>
<div class="loader" v-if="loadingWizard"></div>
<div v-if="error">
{{error}}
@@ -39,7 +28,8 @@
return {
loadingWizard: false,
error: null,
count: 0
count: 0,
tabs: ['test','test2','test3']
}
},
methods: {