mirror of
https://github.com/tenrok/vue-form-wizard.git
synced 2026-06-24 06:10:35 +03:00
Add slots to WizardStep
This commit is contained in:
+7
-2
@@ -12,7 +12,7 @@
|
|||||||
class="card" ref="wizard">
|
class="card" ref="wizard">
|
||||||
<template slot="step" scope="props">
|
<template slot="step" scope="props">
|
||||||
<wizard-step :tab="props.tab"
|
<wizard-step :tab="props.tab"
|
||||||
:transition="props.transition"
|
transition="fade"
|
||||||
:key="props.tab.title"
|
:key="props.tab.title"
|
||||||
:index="props.index">
|
:index="props.index">
|
||||||
</wizard-step>
|
</wizard-step>
|
||||||
@@ -103,5 +103,10 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
<wizard-step :tab="tab"
|
<wizard-step :tab="tab"
|
||||||
@click.native="navigateToTab(index)"
|
@click.native="navigateToTab(index)"
|
||||||
:transition="transition"
|
:transition="transition"
|
||||||
:key="tab.title"
|
|
||||||
:index="index">
|
:index="index">
|
||||||
</wizard-step>
|
</wizard-step>
|
||||||
</slot>
|
</slot>
|
||||||
|
|||||||
@@ -6,22 +6,29 @@
|
|||||||
:style="[tab.checked ? stepCheckedStyle : {}, tab.validationError ? errorStyle : {}]">
|
:style="[tab.checked ? stepCheckedStyle : {}, tab.validationError ? errorStyle : {}]">
|
||||||
|
|
||||||
<transition :name="transition" mode="out-in">
|
<transition :name="transition" mode="out-in">
|
||||||
<div v-if="tab.active" class="wizard-icon-container"
|
|
||||||
:class="{square_shape:isStepSquare, tab_shape:isTabShape}"
|
<div v-if="tab.active" class="wizard-icon-container"
|
||||||
:style="[tab.active ? iconActiveStyle: {}, tab.validationError ? errorStyle : {}]">
|
:class="{square_shape:isStepSquare, tab_shape:isTabShape}"
|
||||||
<i v-if="tab.icon" :class="tab.icon" class="wizard-icon"></i>
|
:style="[tab.active ? iconActiveStyle: {}, tab.validationError ? errorStyle : {}]">
|
||||||
<i v-else class="wizard-icon">{{index + 1}}</i>
|
<slot name="active-step">
|
||||||
</div>
|
<i v-if="tab.icon" :class="tab.icon" class="wizard-icon"></i>
|
||||||
<i v-if="!tab.active && tab.icon" :class="tab.icon" class="wizard-icon"></i>
|
<i v-else class="wizard-icon">{{index + 1}}</i>
|
||||||
<i v-if="!tab.active && !tab.icon" class="wizard-icon">{{index + 1}}</i>
|
</slot>
|
||||||
|
</div>
|
||||||
|
<slot v-if="!tab.active">
|
||||||
|
<i v-if="!tab.active && tab.icon" :class="tab.icon" class="wizard-icon"></i>
|
||||||
|
<i v-if="!tab.active && !tab.icon" class="wizard-icon">{{index + 1}}</i>
|
||||||
|
</slot>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<span class="stepTitle"
|
<slot name="title">
|
||||||
:class="{active:tab.active, has_error:tab.validationError}"
|
<span class="stepTitle"
|
||||||
:style="tab.active ? stepTitleStyle : {}">
|
:class="{active:tab.active, has_error:tab.validationError}"
|
||||||
|
:style="tab.active ? stepTitleStyle : {}">
|
||||||
{{tab.title}}
|
{{tab.title}}
|
||||||
</span>
|
</span>
|
||||||
|
</slot>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user