formspree里面注册账号
注册完成后进入后台新建项目并且新建表单
这一步完成之后你将得到一个地址
最后就是在项目中请求这个地址
关键代码如下:
submitForm() {this.fullscreenLoading = true;this.$axios({method: "post",url: "https://xxxxxxxx",headers: {"Content-Type": "text/html; charset=utf-8",},data: {email: 'email',name: 'name',message: 'message'},}).then((res) => {if (res.data.ok) {this.fullscreenLoading = false;this.$message.success("发送成功!");}}).catch((e) => {this.fullscreenLoading = false;throw e;});
},