getList.then((response: any) => {
console.log(response, response.constructor === Array)
// [{data:1}] , true
if (response.constructor === Array) {
this.setData({
list: response
})
} else {
this.setData({
list: []
})
}
})
微信小程序constructor 判断数据是否为数组
最新推荐文章于 2023-05-11 19:29:03 发布