vue-cli中使用FormData实现表单异步提交

    

    



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;
}
}
});

}

你可能感兴趣的:(javascript,vue.js)