账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    请教vue异步返回数据问题
    26
    0

    刚学vue 回答可能不清楚!见谅。

    getAxios() 是个封装异步请求的(因为要频繁请求同一url);

    我想让getList() 也能拿到getAxios()返回的数据我该怎样处理;

    new Vue({
        el: "#user_order",
        data: {
            Redata:'',
        },
    
        methods: {
        
            getList: function (id){
                let _res = this.getAxios('/demo/index',{id:id});
                console.log(_res);
            },
            
            getAxios: function(url,data){
                let _this = this;
                axios({
                    method:'get',
                    url:url,
                    params:data,
                }).then(function (res) {
                   return res;
                   //_this.Redata = res;
                });
            }
    
        }
    });
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部