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

},

相关推荐
再吃一根胡萝卜9 小时前
不改一行官方源码:用一个插件把 DeepSeek Harness 换成「平安one」
前端
西安小哥9 小时前
做 Agent 写到第三个小时,我开始给它算账
javascript
西安小哥9 小时前
让大模型操作浏览器跑了两周,我发现瓶颈根本不在模型
javascript
涛涛ing9 小时前
2026年,你选的不再是框架,是渲染模型
前端
AiMan9 小时前
Perplexity还是不可导出左侧所有对话,只能单条内容,方法不对吗
前端
用户298698530149 小时前
用 Python 自动化把 JavaScript 代码转换为 Word 文档
javascript·python·api
学以智用9 小时前
正则表达式完整参考手册(JavaScript 版,兼容绝大多数语言)
javascript
AiMan9 小时前
千问生成的内容能否下载吗?
前端
北城笑笑9 小时前
Vue 109 ,从零搭建 Vue3 + Electron 工程:生态、安全桥接与打包选型( Vue + Electron )
前端·javascript·vue.js·安全·electron·vue
JarvanMo9 小时前
Flutter 3.50 & Dart 3.14发布,一起看看有哪些变化!
前端