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('') setCompiledCode('')
setTimeout(() => { setTimeout(() => {
setCompiledCode(`${output}\n${baseDist}`) setCompiledCode(`${output}\n${baseDist}`)
}) }, 100)
}) })
.catch((reason) => { .catch((reason) => {
void message.error(`编译失败:${reason}`) void message.error(`编译失败:${reason}`)

View File

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