Skip to content

Instantly share code, notes, and snippets.

@erowsika
Created May 21, 2018 14:03
Show Gist options
  • Select an option

  • Save erowsika/d6f13f5e1e9aa19cfe4c93839636534c to your computer and use it in GitHub Desktop.

Select an option

Save erowsika/d6f13f5e1e9aa19cfe4c93839636534c to your computer and use it in GitHub Desktop.
<template>
<div class="is-child">
<form-wizard
:currentStep="currentView"
@formwizard-step-change="onFormWizardStepChange">
</form-wizard>
</div>
</template>
<script>
import step1 from './step1'
import step2 from './step2'
import FormWizard from '../../components/formWizard/FormWizard.vue'
export default {
components: {
'form-wizard': FormWizard,
step1,
step2
},
data () {
return {
currentView: step1
}
},
methods: {
onFormWizardStepChange (value) {
if (value === 1) this.currentView = step1
switch (value) {
case 1: {
this.currentView = step1
break
}
case 2: {
this.currentView = step2
break
}
default:
this.currentView = step1
break
}
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment