修复输出面板将dataUrl转为图片显示时,图片大小超出输出面板宽度的BUG

This commit is contained in:
fofolee 2025-02-22 15:21:35 +08:00
parent 857948a105
commit b8578a4baa

View File

@ -56,7 +56,7 @@ export default {
runResult: Array,
selectText: String,
},
emits: ["updateResult"],
emits: ["updateResult", "showImg"],
computed: {
/**
* 处理运行结果数据同时完成以下任务
@ -146,7 +146,9 @@ export default {
const imagePattern = /data:image\/.*?;base64,.*/g;
const imageUrls = this.getFormattedContent()
.match(imagePattern)
?.map((dataUrl) => `<img src="${dataUrl}"><br>`);
?.map(
(dataUrl) => `<img src="${dataUrl}" style="max-width: 100%;"><br>`
);
if (!imageUrls) {
return quickcommand.showMessageBox("dataUrl 格式不正确!");