![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/components/Forms/Edit/ |
<template> <b-modal :id="editAddressModalId" hide-footer modal-class="address-confirm-modal" hide-header-close visible header-class="justify-content-center" :title="modalTitle" no-close-on-backdrop> <ValidationObserver v-slot="{ invalid }" ref="form"> <Address :address-field="addressField" :form="form"/> <div class="form-button-wrapper"> <a href="#" @click.prevent="cancelEdit" class="btn-return"> <svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M5 9L1 5L5 1" stroke="#182D40" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/> </svg> Back </a> <button type="submit" class="btn btn-form-green" @click.prevent="frontendFormSubmitHandler" :disabled=" invalid || !readyToContinue"> Continue <svg width="7" height="13" viewBox="0 0 7 13" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1 1.5L6 6.5L1 11.5" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/> </svg> </button> </div> </ValidationObserver> </b-modal> </template> <script> import forms from "@/mixins/forms"; import Address from "@/components/Forms/Address"; export default { name: "EditAddress", components: {Address}, mixins: [forms], props: { addressField: { required: true }, modalTitle: { required: false, default: 'Change address' }, form: { required: true }, liveUpdate: { required: false, type: Boolean }, ajaxURL: { required: false, type: String } }, data() { return { editAddressModalId: 'edit-address-modal', originalAddress: this.$copyObject(this.form[this.addressField]), readyToContinue: true } }, methods: { submit() { if (this.liveUpdate && this.ajaxURL) { this.$axios.post(this.ajaxURL, { [this.addressField]: this.form[this.addressField] }).then(response => { this.$emit('close-modal') }); } else { this.$emit('close-modal'); } }, cancelEdit() { this.form[this.addressField] = this.$copyObject(this.originalAddress); this.$emit('close-modal'); }, } } </script> <style scoped> </style>