feat(sfc): auto restore current instance after await statements in async setup()
This commit is contained in:
@@ -900,6 +900,11 @@ export function compileScript(
|
||||
}
|
||||
if (node.type === 'AwaitExpression') {
|
||||
hasAwait = true
|
||||
s.prependRight(
|
||||
node.argument.start! + startOffset,
|
||||
helper(`withAsyncContext`) + `(`
|
||||
)
|
||||
s.appendLeft(node.argument.end! + startOffset, `)`)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user