openf12
yujialong 2 years ago
parent ee3bed2210
commit 91b2f034d2
  1. 8
      src/components/codemirror.vue

@ -30,7 +30,7 @@
</div>
<div class="code-right answer">
<p :class="['text-wrapper', 'pic-num' + picSrcList.length]">{{ runResult }}</p>
<div class="pic-wrap" v-if="picSrcList.length">
<div :class="['pic-wrap', {wrong: isError === 0}]" v-if="picSrcList.length">
<div class="pic-item" v-for="(img, i) in picSrcList" :key="i">
<el-image
class="pic"
@ -442,10 +442,11 @@ export default {
if (imgList && imgList.length) firtImg = imgList[0]
//
if (photo) {
this.isError = '' //
this.isError = data.retResult //
const text = result.replace(photo, '') //
this.runResult = text
this.picSrcList = photo.split(',')
this.errLine = parseInt(result.substring(result.indexOf("line") + 4, result.length))
} else if (imgList instanceof Array && imgList.length && typeof firtImg === 'string' && (firtImg.includes('.jpg') || firtImg.includes('.png') || firtImg.includes('img'))) {
/**
* 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来
@ -637,6 +638,9 @@ export default {
margin: 0 auto;
text-align: center;
overflow: auto;
&.wrong {
bottom: 60px;
}
.pic-item {
margin: 0 5px 5px;
&:only-child {

Loading…
Cancel
Save