axios获得的数组为什么不能渲染到网页

图片描述

图片描述

已经获得到返回的数据,但是就是不能渲染到网页中,求大神们帮助,,

axios.post(apiurl,data,{headers:{'auth':sccesstoken}})

        .then(res =>{
            //axios.defaults.headers.common['auth'] = sccesstoken
             console.log(res.data[0].data)
             console.log(res.data[0].data[0].CompanyName);
             this.self.sites = res.data[0].data;
            })
        .catch(function (error) {
            //
        }); 
阅读 3.2k
3 个回答

代码不完整,想看html和data(){}中怎么写的

数据是数据,页面是页面,你想要把数据渲染到页面需要手动处理,如果你用的是angular或者vue框架会自动处理
但是在angular1.x中你用axios的获取数据需要手动刷新 $scope.$apply, vue中也有手动刷新的方法

已经解决,,谢谢各位提供的思路,,非常感谢

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题