index.vue
3.48 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<template>
<div class="container">
<div class="doc-title zan-hairline--bottom">STEPS</div>
<div class="zan-panel">
<div class="zan-cell">
<div class="zan-cell__bd">
<ZanSteps v-bind="{ steps: steps }"/>
</div>
</div>
<div class="zan-cell">
<div class="zan-cell__bd">
<ZanSteps v-bind="{ type: 'horizon', steps: steps2 }"/>
</div>
</div>
<div class="zan-cell zan-cell--last-child">
<div class="zan-cell__bd">
<ZanSteps v-bind="{ type: 'horizon', steps: steps3 }"/>
</div>
</div>
</div>
<div class="zan-panel-title">有描述的steps</div>
<div class="zan-panel">
<div class="zan-cell">
<div class="zan-cell__bd">
<ZanSteps v-bind="{ type: 'horizon', hasDesc: true, steps: steps }"/>
</div>
</div>
<div class="zan-cell">
<div class="zan-cell__bd">
<ZanSteps v-bind="{ type: 'horizon', hasDesc: true, steps: steps2 }"/>
</div>
</div>
<div class="zan-cell zan-cell--last-child">
<div class="zan-cell__bd">
<ZanSteps v-bind="{ type: 'horizon', hasDesc: true, steps: steps3 }"/>
</div>
</div>
</div>
<div class="zan-panel-title">垂直方向的steps</div>
<div class="zan-panel">
<div class="zan-cell zan-cell">
<div class="zan-cell__bd">
<ZanSteps v-bind="{ type: 'vertical', hasDesc: true, steps }"/>
</div>
</div>
<div class="zan-cell zan-cell--last-child">
<div class="zan-cell__bd">
<ZanSteps v-bind="{ type: 'vertical', steps }"/>
</div>
</div>
</div>
<div class="zan-panel-title">可自定义class</div>
<div class="zan-panel">
<div class="zan-cell__bd">
<ZanSteps v-bind="{ type: 'vertical', steps, className: 'my-class' }"/>
</div>
</div>
</div>
</template>
<script>
import ZanSteps from '../../components/zan/steps'
export default {
components: {
ZanSteps
},
data () {
return {
steps: [
{
current: true,
done: true,
text: '步骤一',
desc: '10.01'
},
{
done: false,
current: false,
text: '步骤二',
desc: '10.02'
},
{
done: false,
current: false,
text: '步骤三'
}
],
steps2: [
{
current: false,
done: true,
text: '步骤一',
desc: '10.01'
},
{
done: true,
current: true,
text: '步骤二',
desc: '10.02'
},
{
done: false,
current: false,
text: '步骤三',
desc: '10.03'
}
],
steps3: [
{
current: false,
done: true,
text: '步骤一',
desc: '10.01'
},
{
done: true,
current: false,
text: '步骤二',
desc: '10.02'
},
{
done: true,
current: true,
text: '步骤三',
desc: '10.03'
}
]
}
},
methods: {
handleZanStepperChange (e) {
const {componentId, stepper} = e
this[componentId].stepper = stepper
}
}
}
</script>
<style scoped >
</style>