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

},

相关推荐
奋飛5 分钟前
TypeScript系列:第六篇 - 编写高质量的TS类型
javascript·typescript·ts·declare·.d.ts
老A技术联盟5 分钟前
从小白入门,基于Cursor开发一个前端小程序之Cursor 编程实践与案例分析
前端·小程序
风铃喵游8 分钟前
构建引擎: 打造小程序编译器
前端·小程序·架构
sunbyte13 分钟前
50天50个小项目 (Vue3 + Tailwindcss V4) ✨ | ThemeClock(主题时钟)
前端·javascript·css·vue.js·前端框架·tailwindcss
小飞悟22 分钟前
🎯 什么是模块化?CommonJS 和 ES6 Modules 到底有什么区别?小白也能看懂
前端·javascript·设计
浏览器API调用工程师_Taylor22 分钟前
AOP魔法:一招实现登录弹窗的全局拦截与动态处理
前端·javascript·vue.js
FogLetter23 分钟前
初识图片懒加载:让网页像"懒人"一样聪明加载
前端·javascript
微客鸟窝25 分钟前
一文搞懂NVM管理Node.js:从安装到实战全攻略
前端
归于尽25 分钟前
Cookie、Session、JWT 的前世今生
前端
程序员辉哥26 分钟前
学会在Cursor中使用Rules生成代码后可以躺平了吗?
前端·后端