function getPage(menuId, url) {
  // 这里要有 return
  return this.$http.get(url, {
    	params: {
      	menuId: menuId
    	}
  }).then((response) => {
    return response.data
  }).catch(function (error) {
    console.log(error);
  })
}

async function addTab(component, title, menuId, url) {
  page = await this.getPage(menuId, url);
}

// 调用 addTab 的时候就会等 getPage() 调用完成后才会结束
addTab(...)

相关文章:

  • 2021-06-17
  • 1970-01-01
  • 2021-11-16
  • 2021-11-24
  • 2022-12-23
  • 2021-11-28
  • 2021-07-23
  • 2021-01-05
猜你喜欢
  • 2021-11-29
  • 2021-11-13
  • 2022-01-29
  • 2022-12-23
  • 2021-05-17
  • 2021-10-12
  • 2021-09-08
相关资源
相似解决方案