成都创新互联网站制作重庆分公司

vue获取form表单的值示例

这里使用的是Element-ui组件

赤峰林西网站制作公司哪家好,找成都创新互联!从网页设计、网站建设、微信开发、APP开发、响应式网站设计等网站项目制作,到程序开发,运营维护。成都创新互联公司2013年成立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选成都创新互联

html:

JS:

var phone = this.phone;
var password = this.password;

var that = this;
 var phone = that .phone;
 var password = that .password;
this.$axios({
  method:'post',
  url:'api/user/logout',
  data:this.qs.stringify({phone:phone,password:password})
 }).then((res) =>{   //这里使用了ES6的语法
  if (res.data.status==200){
   alert(res.data.message);
   this.$emit('userSignIn', ''); //记录登录状态
   this.$router.replace({path: '/login'}); //成功后跳转
  }
 }).catch((error) =>{
  alert(error.data.message)  //请求失败返回的数据
 })

以上这篇vue获取form表单的值示例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持创新互联。


分享标题:vue获取form表单的值示例
分享网址:http://cxhlcq.com/article/gjghss.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部