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

},

相关推荐
yuzhiboyouye13 小时前
VO一般java后端怎么转换成前端想要的数据
java·前端·状态模式
小脑斧12313 小时前
从范式重构到工程落地:OpenTiny NEXT 引领前端智能化新范式
前端·hermesagent·opentiny next
小江的记录本13 小时前
【AI大模型选型指南】《2026年5月(最新版)国内外主流AI大模型选型指南》(企业版)
前端·人工智能·后端·ai作画·aigc·ai编程·ai写作
幽络源小助理13 小时前
最新轻量美化表白墙系统源码v2.0_带后台版_附搭建教程
前端·开源·源码·php源码
qq_3813385014 小时前
前端状态管理新范式:Zustand、Jotai 与 Preact Signals 深度对比
前端·arcgis
布局呆星14 小时前
Vue Router 笔记(二):正则路由、组件通信与动态路由
前端·javascript·vue.js
丑八怪大丑14 小时前
HTML&CSS
前端·css·html
团象科技14 小时前
全渠道出海布局之下,多币种云结算承担着怎样的作用
前端·人工智能
rising start14 小时前
InsightEdu - 轻量智能学习平台
javascript·axios·css3·html5·fastapi·orm·dify
lolo大魔王14 小时前
Go 语言 Web 框架 Gin 入门详解
前端·golang·gin