This repository was archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 243
/
Copy pathWizardRoute.vue
102 lines (98 loc) · 2.5 KB
/
WizardRoute.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<template>
<div>
<button @click="tabs.shift()">Remove one at start</button>
<button @click="tabs.push('testt')">Add at the end</button>
<button @click="tabs.unshift('new start')">Add one at start</button>
<router-link to="/test">Go to a different route</router-link>
<form-wizard @on-complete="onComplete"
@on-change="handleChange"
:start-index.sync="activeIndex"
color="#e74c3c">
<tab-content v-for="tab in tabs" :title="tab" :key="tab">{{tab}}</tab-content>
<transition name="fade" mode="out-in">
<router-view></router-view>
</transition>
</form-wizard>
</div>
</template>
<script>
import TabContent from "../src/components/TabContent";
export default {
components: {TabContent},
data () {
return {
loadingWizard: false,
error: null,
count: 0,
tabs: ['test', 'test2', 'test3'],
activeIndex: 0
}
},
methods: {
onComplete () {
alert('Yay!')
},
setLoading (value) {
this.loadingWizard = value
},
handleChange(prevIndex, nextIndex){
console.log(`Changing from ${prevIndex} to ${nextIndex}`)
},
setError (error) {
this.error = error
},
validateAsync () {
//simulating an error for the first time and a success for the second time
return new Promise((resolve, reject) => {
setTimeout(() => {
if (this.count % 2 === 0) {
reject('Some custom error')
} else {
resolve(true)
}
this.count++
}, 100)
})
},
validate () {
return true
}
}
}
</script>
<style>
@import "loader.css";
</style>
<style lang="scss">
.steps-size{
width: 200px;
height: 400px;
}
$border-radius-extreme: 6px !default;
$white-color: white;
$gray-input-bg: #F3F2EE !default;
$card-black-color: #252422 !default;
body {
margin-top: 20px;
background-color: #ecf0f1;
}
.card-footer {
padding: 0px 20px;
}
.card {
border-radius: $border-radius-extreme;
box-shadow: 0 2px 2px rgba(204, 197, 185, 0.5);
background-color: $white-color;
color: $card-black-color;
padding: 10px 0;
margin-bottom: 20px;
position: relative;
z-index: 1;
}
.fade-enter-active, .fade-leave-active {
transition: opacity .2s
}
.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
opacity: 0
}
</style>