数据库读取的数据怎么在小程序中调用?

小程序 文章 2021-03-08 17:21 0 23 全屏看文

数据库读取的数据怎么在小程序中调用?How can the data read by the database be called in the applet?

数据库读取的数据怎么在小程序中调用?

数据库读取的数据如下:

[{"id":"1","User_name":"u5f20u5b89","User_age":"18","User_addr":"u4e0au6d77u5e02"},{"id":"2","User_name":"u738bu4f4d","User_age":"32","User_addr":"u5929u6d25u5e02"}]

如何在小程序中调用这些数据



The data read from the database is as follows: [{"Id": "1", "user"_ name":"u5f20u5b89","User_ age":"18","User_ addr":"u4e0au6d77u5e02"},{"id":"2","User_ name":"u738bu4f4d","User_ age":"32","User_ Addr: "u5929u6d25u5e02" "how do we call these data in small programs?

回答:

KKO:

success:(res)=>{ 

let array = res.data.newslist[0];  //储存控制台里的数据   

          this.setData({

            array:array //进行整体赋值,渲染到页面

          })

}

X:

写接口给前端调用

Brother斌🎈:

写成接口给前端调用?

默垂眸:

把数据渲染到页面?

-EOF-