this指向问题

mounted(){     let that=this;     let xhr=new XMLHttpRequest();     // xhr.responseType="json";     let user={name:"xiaoliu",password:123456};   //   xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");     xhr.open("POST","http://localhost:8080/");     user=JSON.stringify(user);     xhr.send(user);     xhr.onreadystatechange=function(){       if(xhr.readyState===4){         // let res=JSON.parse(xhr.response)         console.log("xhr.response",xhr.response);
        let val = xhr.response;         that.msg = val;         // this.$forceUpdate();         // this.$set(this.msg,xhr.response)         console.log("this.msg",this.msg)       }     }   },
上一篇:SVM官方教程:SVR 简易教程


下一篇:CentOS 7.4 基于LNMP搭建wordpress