window.addEventListener("load", () => loadEdit(), false);
async function loadEdit() {
// do the await things here.
}
异步函数返回承诺。因此,如果您想在
loadEdit
之后做一些事情,请尝试:
window.addEventListener("load", () => {
loadEdit().then(/* callback function here */);
}, false);
async function loadEdit() {
// do the await things here.
}