AddAddress option buttonType: component manage button in edit or create context

This commit is contained in:
2021-08-17 15:41:03 +02:00
parent 43f9e50100
commit cdc6cf211a
9 changed files with 35 additions and 49 deletions

View File

@@ -32,7 +32,7 @@
ref="addAddress">
</add-address>
</li>
<li v-if="isContextEdit && isPersonLocation">
<li v-if="isPersonLocation">
<button
class="btn btn-remove"
@click="removeAddress"
@@ -112,10 +112,6 @@ export default {
}
this.$store.commit('setAddressContext', context);
},
initAddressOptions() {
// here button.type is a contextual option
this.$refs.addAddress.$data.default.button.type = this.isContextEdit ? 'btn-update' : '';
},
removeAddress() {
console.log('remove address');
let payload = {
@@ -133,11 +129,11 @@ export default {
let payload = this.$refs.addAddress.submitNewAddress();
payload['locationStatusTo'] = 'address'; // <== temporary, not none, not person
this.$store.dispatch('updateLocation', payload);
this.$store.commit('setEditContextTrue');
}
},
mounted() {
this.initAddressContext();
this.initAddressOptions();
console.log('ac.locationStatus', this.accompanyingCourse.locationStatus);
console.log('ac.location (temporary location)', this.accompanyingCourse.location);