mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
adding options in root component to see result or redirect (not working)
This commit is contained in:
parent
b62597426c
commit
da09e10fb1
@ -1,9 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div v-for="error in displayErrors"
|
<div v-for="error in displayErrors" class="alert alert-danger my-2">
|
||||||
class="alert alert-danger my-2">
|
|
||||||
{{ error }}
|
{{ error }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="addAddress.options.displayResult && addAddress.result !== null"
|
||||||
|
class="chill-entity entity-address">
|
||||||
|
<div class="address multiline">
|
||||||
|
<p class="street">{{ addAddress.result.street }}
|
||||||
|
<span class="streetnumber">{{ addAddress.result.streetNumber }}</span>
|
||||||
|
</p>
|
||||||
|
<p class="postcode">
|
||||||
|
<span class="code">{{ addAddress.result.postcode.code }}</span>
|
||||||
|
<span class="name">{{ addAddress.result.postcode.name }}</span>
|
||||||
|
</p>
|
||||||
|
<p class="country">{{ addAddress.result.country.name.fr }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<add-address
|
<add-address
|
||||||
v-bind:key="addAddress.type"
|
v-bind:key="addAddress.type"
|
||||||
v-bind:context="context"
|
v-bind:context="context"
|
||||||
@ -46,9 +60,13 @@ export default {
|
|||||||
|
|
||||||
/// Display each step in page or Modal
|
/// Display each step in page or Modal
|
||||||
bindModal: {
|
bindModal: {
|
||||||
step1: false,
|
//step1: false,
|
||||||
step2: false
|
//step2: false
|
||||||
}
|
},
|
||||||
|
|
||||||
|
// Options only for root parent component
|
||||||
|
displayResult: true,
|
||||||
|
redirectToBackUrl: false
|
||||||
},
|
},
|
||||||
type: 'person',
|
type: 'person',
|
||||||
result: null // <== returned from addAddress component
|
result: null // <== returned from addAddress component
|
||||||
|
@ -511,11 +511,14 @@ export default {
|
|||||||
.then(person => new Promise((resolve, reject) => {
|
.then(person => new Promise((resolve, reject) => {
|
||||||
|
|
||||||
console.log('commit addAddressToPerson !!!', person);
|
console.log('commit addAddressToPerson !!!', person);
|
||||||
this.result = person;
|
this.$props.result = person;
|
||||||
|
|
||||||
this.flag.loading = false;
|
this.flag.loading = false;
|
||||||
this.flag.success = true;
|
this.flag.success = true;
|
||||||
window.location.assign(payload.backUrl);
|
|
||||||
|
if (this.options.redirectToBackUrl) {
|
||||||
|
window.location.assign(payload.backUrl);
|
||||||
|
}
|
||||||
resolve();
|
resolve();
|
||||||
}))
|
}))
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user