<form v-on:submit="addCustomer">
<button type="submit" class="btn btn-primary">添加</button>
</form>
addCustomer(e){
//console.log(12221);
if(!this.coustomer.name || !this.customer.phone || !this.coustomer.email){
this.alert="請輸入電話郵箱和姓名!!!";
}else{
let newCustomer={
name:this.coustomer.name,
....
}
e.preventDefault();
}
}
}