<form @submit.prevent="submit($event)">

    <input type="text" class="form-control" placeholder="请输入姓名" name="cuserName">

    <input type="submit" value="立即注册" class="denglucon" />

</form>



submit: function(event) {

        var formData = new FormData(event.target);

                                $.ajax({
type: "post",
url: that.service + "/register",
dataType: 'json',
contentType: false,
processData: false,
data: formData,
success: function(res) {
if(res.status != 200) {
alert(res.msg)
return false;
}
}
});

}

Logo

前往低代码交流专区

更多推荐