4、axios

作者: 西瓜少女233 | 来源:发表于2018-08-03 23:52 被阅读0次

    1、npm install axios
    2、在main.js中引入
    import axios from 'axios'
    Vue.prototype.$http = axios;


    屏幕快照 2018-08-03 23.52.39.png

    3、在需要传数据的组件中
    v-model 绑定双向数据


    屏幕快照 2018-08-03 23.50.49.png
    屏幕快照 2018-08-03 23.50.36.png

    this.$http.post('https://iqd-api.kimchou.com/api/v1/member/agent/join',{
    mobile: this.model.mobile,
    platform: this.model.platform,
    name: this.model.name
    }).then(function(response){
    console.log(response);
    })

    相关文章

      网友评论

          本文标题:4、axios

          本文链接:https://www.haomeiwen.com/subject/zokpvftx.html