es6 Promise.all 用法

init() {

this.pageLoading = true;

Promise.all(this.getTime(), this.getAddress())

.then((time, host) => {

this.loading= false;

this.form.time= time;

this.form.host = host;

})

.catch(() => {

this.loding= false;

});

},

getTime() {

return this.$post("/query");

},

// 查询上次时间同步的地址

getAddress() {

return this.$post("/del");

},

mounted() {

this.init()

},

相关推荐
Coodor5 分钟前
使用web也可以写NFC微信小程序拉取
前端·微信小程序·小程序·nfc拉起小程序
Wang's Blog1 小时前
Vibe Coding一人即团队系列28: 前端、后端与数据库的概念解析
前端·数据库
Dovis(誓平步青云)1 小时前
模拟器横评:电脑上看小说、追短剧用什么模拟器?MuMu、雷电、腾讯手游助手实测
android·java·服务器·前端·javascript·电脑
踩蚂蚁1 小时前
把自定义唤醒词部署到 ESP32-S3:ONNX 转 INT8 TFLite 的完整链路
前端
前端繁华如梦1 小时前
用 Vite + Electron + React + Python 重造 3D 服装打版软件
前端
豆沙沙包?1 小时前
函数重载/类和对象(P14-P60)
前端·算法
三十而立洋2 小时前
彻底搞懂跨域:原理、CORS、解决方案与实战避坑
前端
xiaominlaopodaren2 小时前
three.js最小地图运行时(十):接入离线逻辑瓦片剖面
javascript·gis·three.js
计算机魔术师2 小时前
ASR转录总出错?Google新模型WER降到2.6%,还能自动帮你改口误
前端