3👍
✅
the customer
data element is not mentioned in data object property, so your code should be like :
<button type="button" @click="addCustomers"
:disabled="disableSubmitButton" class="btn btn-primary" style="float:
right;" value="ADD CUSTOMER">{{loading ? "Loading..." : "ADD
CUSTOMER"}}</button>
and in the methods:
addCustomers(){
this.loading = true;
axios.post().then(res=>{
this.loading=false;
}).catch(err=>{
//handle error
})
}
Source:stackexchange.com