|
I'm new to ts. 如图,getServerStatus()方法返回一个Promise(因为这个方法内部涉及到http请求),我理应在前面加上await获取到Server[],但action的callback不能返回一个Promise。 |
Answered by
shigma
Jul 16, 2024
Replies: 1 comment
|
command 的 action 是异步的,加个 async 即可。 .action(async () => {
await getServerStatus()
}) |
0 replies
Answer selected by
sectlying
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

command 的 action 是异步的,加个 async 即可。