运行结果显示成文本

develop
jialong.yu 3 years ago
parent 1c93ae2793
commit e12ee2a220
  1. 4
      src/components/codemirror.vue

@ -17,7 +17,7 @@
>运行</el-button> >运行</el-button>
</div> </div>
<div class="code-right answer"> <div class="code-right answer">
<p class="text-wrapper" v-html="runResult"></p> <p class="text-wrapper">{{ runResult }}</p>
<div class="pic-wrap" v-if="picSrc"> <div class="pic-wrap" v-if="picSrc">
<div style="margin-bottom: 5px;text-align: center"> <div style="margin-bottom: 5px;text-align: center">
<img class="pic" :src="picSrc" alt=""> <img class="pic" :src="picSrc" alt="">
@ -179,7 +179,7 @@ export default {
this.$prompt(receiveResult, '提示', { this.$prompt(receiveResult, '提示', {
confirmButtonText: "确定" confirmButtonText: "确定"
}).then(({ value }) => { }).then(({ value }) => {
this.runResult += `${value}<br>` this.runResult += `${value}\n`
// exit // exit
this.sourceCode = this.sourceCode.replace(`exit('validing:${receiveResult.replace(/[\r\n]*/g,'')}')`, _ => { this.sourceCode = this.sourceCode.replace(`exit('validing:${receiveResult.replace(/[\r\n]*/g,'')}')`, _ => {
return `'${value}'` return `'${value}'`

Loading…
Cancel
Save