Demo issue fixed

pull/3027/head
Bahadir Sofuoglu 2022-09-23 18:42:46 +03:00
parent 36f3e3f20e
commit 14ae2f9e47
1 changed files with 48 additions and 31 deletions

View File

@ -3,7 +3,10 @@
<div class="content-section introduction">
<div class="feature-intro">
<h1>Steps</h1>
<p>Steps components is an indicator for the steps in a wizard workflow. Example below uses nested routes with Steps.</p>
<p>
Steps components is an indicator for the steps in a wizard
workflow. Example below uses nested routes with Steps.
</p>
</div>
</div>
@ -13,7 +16,12 @@
</div>
<keep-alive>
<router-view :formData="formObject" @prevPage="prevPage($event)" @nextPage="nextPage($event)" @complete="complete" />
<router-view
:formData="formObject"
@prevPage="prevPage($event)"
@nextPage="nextPage($event)"
@complete="complete"
/>
</keep-alive>
</div>
@ -22,38 +30,38 @@
</template>
<script>
import StepsDoc from './StepsDoc';
import StepsDoc from "./StepsDoc";
export default {
data() {
return {
items: [{
label: 'Personal',
to: '/steps'
},
{
label: 'Seat',
to: '/steps/seat'
},
{
label: 'Payment',
to: '/steps/payment'
},
{
label: 'Confirmation',
to: '/steps/confirmation'
}],
formObject: {}
}
items: [
{
label: "Personal",
to: "/steps",
},
{
label: "Seat",
to: "/steps/seat",
},
{
label: "Payment",
to: "/steps/payment",
},
{
label: "Confirmation",
to: "/steps/confirmation",
},
],
formObject: {},
};
},
components: {
'StepsDoc': StepsDoc
StepsDoc: StepsDoc,
},
methods: {
nextPage(event) {
for (let field in event.formData) {
this.formObject[field] = event.formData[field];
}
this.formObject = { ...this.formObject, ...event.formData };
this.$router.push(this.items[event.pageIndex + 1].to);
},
@ -61,18 +69,27 @@ export default {
this.$router.push(this.items[event.pageIndex - 1].to);
},
complete() {
this.$toast.add({severity:'success', summary:'Order submitted', detail: 'Dear, ' + this.formObject.firstname + ' ' + this.formObject.lastname + ' your order completed.'});
}
}
}
this.$toast.add({
severity: "success",
summary: "Order submitted",
detail:
"Dear, " +
this.formObject.firstname +
" " +
this.formObject.lastname +
" your order completed.",
});
},
},
};
</script>
<style scoped lang="scss">
::v-deep b {
display: block
display: block;
}
::v-deep .p-card-body {
padding: 2rem;
}
</style>
</style>