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

Commit 0cdc048

Browse files
committed
#22 Initial support for vertical tabs
1 parent 74f04a5 commit 0cdc048

File tree

3 files changed

+37
-4
lines changed

3 files changed

+37
-4
lines changed

dev-example/WizardRoute.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<form-wizard @on-complete="onComplete"
88
@on-change="handleChange"
99
:start-index.sync="activeIndex"
10-
shape="tab"
10+
layout="vertical"
11+
steps-classes="steps-size"
1112
color="#e74c3c">
1213
<tab-content v-for="tab in tabs" :title="tab" :key="tab">{{tab}}</tab-content>
1314
<transition name="fade" mode="out-in">
@@ -66,6 +67,10 @@
6667
@import "loader.css";
6768
</style>
6869
<style lang="scss">
70+
.steps-size{
71+
width: 200px;
72+
height: 400px;
73+
}
6974
$border-radius-extreme: 6px !default;
7075
$white-color: white;
7176
$gray-input-bg: #F3F2EE !default;

src/assets/form-wizard/_wizard-card.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,21 @@
125125
}
126126
}
127127
}
128+
129+
&.vertical {
130+
.wizard-card-footer {
131+
display: block;
132+
}
133+
.wizard-nav-pills {
134+
flex-direction: column;
135+
}
136+
.wizard-navigation {
137+
display: flex;
138+
flex-direction: row;
139+
}
140+
.wizard-card-footer {
141+
padding-top: 30px;
142+
143+
}
144+
}
128145
}

src/components/FormWizard.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<template>
2-
<div class="vue-form-wizard" :class="stepSize" @keyup.right="focusNextTab" @keyup.left="focusPrevTab">
2+
<div class="vue-form-wizard" :class="[stepSize, {vertical: isVertical}]" @keyup.right="focusNextTab" @keyup.left="focusPrevTab">
33
<div class="wizard-header">
44
<slot name="title">
55
<h4 class="wizard-title">{{title}}</h4>
66
<p class="category">{{subtitle}}</p>
77
</slot>
88
</div>
99
<div class="wizard-navigation">
10-
<div class="wizard-progress-with-circle">
10+
<div class="wizard-progress-with-circle" v-if="!isVertical">
1111
<div class="wizard-progress-bar"
1212
:style="progressBarStyle"></div>
1313
</div>
14-
<ul class="wizard-nav wizard-nav-pills" role="tablist">
14+
<ul class="wizard-nav wizard-nav-pills" role="tablist" :class="stepsClasses">
1515
<slot name="step" v-for="(tab, index) in tabs"
1616
:tab="tab"
1717
:index="index"
@@ -122,6 +122,14 @@
122122
type: String,
123123
default: 'circle'
124124
},
125+
layout: {
126+
type: String,
127+
default: 'horizontal'
128+
},
129+
stepsClasses: {
130+
type: [String, Array],
131+
default: ''
132+
},
125133
stepSize: {
126134
type: String,
127135
default: 'md',
@@ -174,6 +182,9 @@
174182
isLastStep () {
175183
return this.activeTabIndex === this.tabCount - 1
176184
},
185+
isVertical () {
186+
return this.layout === 'vertical'
187+
},
177188
displayPrevButton () {
178189
return this.activeTabIndex !== 0
179190
},

0 commit comments

Comments
 (0)