低調的D吖 2019-10-06 06:45 采纳率: 0%
浏览 170

submit 為什麼無法使用addCustomer方法

<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();
                }
    }
    }
  • 写回答

2条回答 默认 最新

  • threenewbee 2019-10-06 09:37
    关注

    怎么叫无法使用,全部删除掉,就保留console.log(12221);,有输出么

    评论

报告相同问题?