Fix(ToolExecute and ToolView): Fix the bug that can not load tool

Fix the bug that can not load tool when switch tool
This commit is contained in:
2024-05-01 18:07:42 +08:00
parent cab0c9d879
commit 6e2012cd7a
2 changed files with 6 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ const Execute = () => {
setCompiledCode('')
setTimeout(() => {
setCompiledCode(`${output}\n${baseDist}`)
})
}, 100)
})
.catch((reason) => {
void message.error(`编译失败:${reason}`)

View File

@@ -35,7 +35,7 @@ const View = () => {
setCompiledCode('')
setTimeout(() => {
setCompiledCode(`${output}\n${baseDist}`)
})
}, 100)
})
.catch((reason) => {
void message.error(`编译失败:${reason}`)
@@ -47,7 +47,10 @@ const View = () => {
try {
const baseDist = base64ToStr(toolVo.base.dist.data!)
const dist = base64ToStr(toolVo.dist.data!)
setCompiledCode(`${dist}\n${baseDist}`)
setCompiledCode('')
setTimeout(() => {
setCompiledCode(`${dist}\n${baseDist}`)
}, 100)
} catch (e) {
void message.error('载入工具失败')
}