diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index 581d5d9..0b2f476 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -39,6 +39,7 @@ :textbtn="!enableHtml" :imagebtn="!enableHtml && isDataUrl" @showImg="showBase64Img" + @updateResult="runResult = $event" :style="{ height: headerHeight + 'px', }" diff --git a/src/components/ResultArea.vue b/src/components/ResultArea.vue index 8a3d888..2441449 100644 --- a/src/components/ResultArea.vue +++ b/src/components/ResultArea.vue @@ -22,7 +22,12 @@ v-else-if="typeof item === 'undefined'" v-text="'undefined'" /> -
+ @@ -78,6 +83,10 @@ export default { ) : ""; }, + // 判断是否是转为表格的结果,表格结果不需要换行,第二行一般包含分隔符--- + isTable() { + return this.runResult?.[0]?.split("\n")?.[1]?.includes("---"); + }, }, mounted() { this.frameInit(); @@ -135,16 +144,22 @@ export default { .text { font-family: Consolas, Monaco, "Courier New"; } + .result { - white-space: pre-wrap; word-wrap: break-word; max-width: 100%; margin: 0; } + +.result.wrapLine { + white-space: pre-wrap; +} + .undefined { color: #999; font-style: italic; } + iframe { width: 100%; display: block; diff --git a/src/components/popup/ResultMenu.vue b/src/components/popup/ResultMenu.vue index ecc10d6..d5e20b5 100644 --- a/src/components/popup/ResultMenu.vue +++ b/src/components/popup/ResultMenu.vue @@ -1,13 +1,32 @@ -