update 优化xml预览和svg预览

This commit is contained in:
LiuHao 2024-02-04 11:46:06 +08:00
parent 1663c587e8
commit 3fbd4657f4

View File

@ -66,13 +66,13 @@
</el-container> </el-container>
</div> </div>
</div> </div>
<div class="preview-XML"> <div>
<el-dialog v-model="perviewXMLShow" title="XML预览" width="80%"> <el-dialog v-model="perviewXMLShow" title="XML预览" width="80%" append-to-body>
<highlightjs :code="xmlStr" language="XML" /> <highlightjs :code="xmlStr" language="XML" />
</el-dialog> </el-dialog>
</div> </div>
<div> <div>
<el-dialog v-model="perviewSVGShow" title="SVG预览" width="80%"> <el-dialog v-model="perviewSVGShow" title="SVG预览" width="80%" append-to-body>
<div style="text-align: center" v-html="svgData" /> <div style="text-align: center" v-html="svgData" />
</el-dialog> </el-dialog>
</div> </div>
@ -361,18 +361,16 @@ defineExpose({
} }
} }
} }
.preview-XML { pre {
pre { margin: 0;
margin: 0; height: 100%;
height: 100%; max-height: calc(80vh - 32px);
max-height: calc(80vh - 32px); overflow-x: hidden;
overflow-x: hidden; overflow-y: auto;
overflow-y: auto; :deep(.hljs) {
:deep(.hljs) { word-break: break-word;
word-break: break-word; white-space: pre-wrap;
white-space: pre-wrap; padding: 0.5em;
padding: 0.5em;
}
} }
} }