欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue獲取form表單的值示例

 更新時間:2019年10月29日 17:04:45   作者:即墨丹青  
今天小編就為大家分享一篇vue獲取form表單的值示例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

這里使用的是Element-ui組件

html:

<el-input placeholder="請輸入手機(jī)號" id="phone" prop="phone" v-model="phone" clearable></el-input>

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', ''); //記錄登錄狀態(tài)
   this.$router.replace({path: '/login'}); //成功后跳轉(zhuǎn)
  }
 }).catch((error) =>{
  alert(error.data.message)  //請求失敗返回的數(shù)據(jù)
 })

以上這篇vue獲取form表單的值示例就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論