1027230830@qq.com
1027230830@qq.com
  • 发布:2019-11-07 01:06
  • 更新:2019-11-07 12:23
  • 阅读:391

nui-app uni.request返回值

分类:uni-app

uni.request({
url: 'http://127.0.0.1:8089/readBook/bookdetails',
method: 'GET',
data: {},
success: res => {
console.log('数据'+res.data);
},
fail: () => {},
complete: () => {}
});

请问我怎么才能把这个res.data 显示到标签中。同一个界面

2019-11-07 01:06 负责人:无 分享
已邀请:
1335360669@qq.com

1335360669@qq.com

<view>{{data}}</view>  

data() {  
  return {  
       data:null  
  }  
}  

onLoad(){  
   uni.request({  
     url: 'http://127.0.0.1:8089/readBook/bookdetails',  
     method: 'GET',  
     data: {},  
     success: res => {  
          console.log('数据'+res.data);  
          this.data = res.data;  
     },  
     fail: () => {},  
     complete: () => {}  
    });  
}

要回复问题请先登录注册