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()

},

相关推荐
爱勇宝4 小时前
大多数人不是在使用 AI 赚钱,而是在帮 AI 公司赚钱
前端·后端·程序员
冬奇Lab5 小时前
每日一个开源项目(第143篇):page-agent - 纯 JS 的网页 GUI Agent,无需截图、无需插件、无需后端
前端·人工智能·agent
To_OC6 小时前
LC 994 腐烂的橘子:人人都说是 BFS 入门题,我却写了三遍才过
javascript·算法·leetcode
IT_陈寒9 小时前
React的这个渲染问题连官方文档都没说清楚
前端·人工智能·后端
追逐时光者11 小时前
别再满网找零散工具了,腾讯 QQ 浏览器这个“帮小忙”工具箱真能省时间
前端·后端
To_OC12 小时前
LC 200 岛屿数量:经典 DFS 入门题,我第一次写居然连方向都搞错了
javascript·算法·leetcode
Asmewill13 小时前
grep&curl命令学习笔记
前端
stringwu13 小时前
Flutter 开发必备:MVI 架构的高效实现指南
前端·flutter
用户21366100357214 小时前
Vue2组件化开发与父子通信
前端·vue.js
Momo__14 小时前
TypeScript satisfies 操作符——比 as 更安全的类型守门员
前端·typescript