异步查询数据,需要对返回的数据进行后续步骤操作,使用使用方法:

1、new promise方法使用。

2、回调函数使用

  使用方式:  

 pageGetDeviceTreeInfo({deviceTypeAry:[1]},this.getTreeData); 

  函数:

1 export function pageGetDeviceTreeInfo(param,callback){  // 区域树接口查询,const param = {deviceType:1};//deviceType:1,人脸抓拍;2,车辆抓拍;3,WIFI感知;4,门禁感知
2   getRegionTree(param).then(rsp =>{
3     if(rsp.status==200){
4       callback(rsp.data);
5     } else {
6       callback([]);
7     }
8   });
9 };

  回调函数:

getTreeData(rstData){ // 回调函数
 console.log(rstData);
}

 

相关文章:

  • 2022-12-23
  • 2021-10-26
  • 2021-12-02
  • 2021-11-07
  • 2021-11-24
  • 2021-09-07
  • 2022-12-23
猜你喜欢
  • 2021-11-13
  • 2021-12-15
  • 2021-08-04
  • 2022-12-23
  • 2020-05-18
相关资源
相似解决方案