mirror of
https://github.com/tenrok/vue-form-wizard.git
synced 2026-06-24 02:40:32 +03:00
Add name for WizardStep
This commit is contained in:
@@ -5,24 +5,14 @@
|
|||||||
<button @click="tabs.unshift('new start')">Add one at start</button>
|
<button @click="tabs.unshift('new start')">Add one at start</button>
|
||||||
<router-link to="/test">Go to a different route</router-link>
|
<router-link to="/test">Go to a different route</router-link>
|
||||||
<form-wizard @on-complete="onComplete"
|
<form-wizard @on-complete="onComplete"
|
||||||
shape="circle"
|
@on-change="handleChange"
|
||||||
|
:start-index.sync="activeIndex"
|
||||||
|
shape="tab"
|
||||||
color="#e74c3c">
|
color="#e74c3c">
|
||||||
<tab-content title="Personal details"
|
<tab-content v-for="tab in tabs" :title="tab" :key="tab">{{tab}}</tab-content>
|
||||||
route="/first"
|
|
||||||
icon="ti-user">
|
|
||||||
</tab-content>
|
|
||||||
<tab-content title="Additional Info"
|
|
||||||
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">
|
<transition name="fade" mode="out-in">
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
</form-wizard>
|
</form-wizard>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -36,7 +26,8 @@
|
|||||||
loadingWizard: false,
|
loadingWizard: false,
|
||||||
error: null,
|
error: null,
|
||||||
count: 0,
|
count: 0,
|
||||||
tabs: ['test', 'test2', 'test3']
|
tabs: ['test', 'test2', 'test3'],
|
||||||
|
activeIndex: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -46,6 +37,9 @@
|
|||||||
setLoading (value) {
|
setLoading (value) {
|
||||||
this.loadingWizard = value
|
this.loadingWizard = value
|
||||||
},
|
},
|
||||||
|
handleChange(prevIndex, nextIndex){
|
||||||
|
console.log(`Changing from ${prevIndex} to ${nextIndex}`)
|
||||||
|
},
|
||||||
setError (error) {
|
setError (error) {
|
||||||
this.error = error
|
this.error = error
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
name: 'wizard-step',
|
||||||
props: {
|
props: {
|
||||||
tab: {
|
tab: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
Reference in New Issue
Block a user