2
0
mirror of https://github.com/tenrok/vue-form-wizard.git synced 2026-06-12 18:12:24 +03:00

#27 Expose footer content as a scoped slot

This commit is contained in:
cristijora
2017-07-31 20:18:27 +03:00
parent 69d05eecac
commit 4dae5493ca
4 changed files with 45 additions and 15 deletions
+24 -14
View File
@@ -35,7 +35,6 @@
:style="tab.active ? stepTitleStyle : {}">
{{tab.title}}
</span>
</a>
</li>
</ul>
@@ -46,44 +45,55 @@
</div>
<div class="wizard-card-footer clearfix" v-if="!hideButtons">
<template>
<slot name="footer"
:next-tab="nextTab"
:prev-tab="prevTab"
:active-tab-index="activeTabIndex"
:is-last-step="isLastStep"
:fill-button-style="fillButtonStyle">
<template>
<span @click="prevTab" v-if="displayPrevButton" class="wizard-footer-left">
<slot name="prev">
<button type="button" class="wizard-btn btn-default wizard-btn-wd" :style="fillButtonStyle"
<wizard-button :style="fillButtonStyle"
:disabled="loading">
{{backButtonText}}
</button>
</wizard-button>
</slot>
</span>
</template>
</template>
<template>
<template>
<span @click="finish" class="wizard-footer-right" v-if="isLastStep">
<slot name="finish">
<button type="button" class="wizard-btn btn-fill wizard-btn-wd btn-next" :style="fillButtonStyle">
<wizard-button :style="fillButtonStyle">
{{finishButtonText}}
</button>
</wizard-button>
</slot>
</span>
</template>
</template>
<template>
<template>
<span @click="nextTab" class="wizard-footer-right" v-if="!isLastStep">
<slot name="next">
<button type="button" class="wizard-btn btn-fill wizard-btn-wd btn-next" :style="fillButtonStyle"
<wizard-button :style="fillButtonStyle"
:disabled="loading">
{{nextButtonText}}
</button>
</wizard-button>
</slot>
</span>
</template>
</template>
</slot>
</div>
</div>
</template>
<script>
import WizardButton from './WizardButton.vue'
export default{
name: 'form-wizard',
components: {
WizardButton
},
props: {
title: {
type: String,
+10
View File
@@ -0,0 +1,10 @@
<template>
<button type="button" class="wizard-btn btn-fill wizard-btn-wd">
<slot></slot>
</button>
</template>
<script>
export default {}
</script>
<style>
</style>