mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-18 12:36:58 +08:00
修复输出面板将dataUrl转为图片显示时,图片大小超出输出面板宽度的BUG
This commit is contained in:
parent
857948a105
commit
b8578a4baa
@ -56,7 +56,7 @@ export default {
|
|||||||
runResult: Array,
|
runResult: Array,
|
||||||
selectText: String,
|
selectText: String,
|
||||||
},
|
},
|
||||||
emits: ["updateResult"],
|
emits: ["updateResult", "showImg"],
|
||||||
computed: {
|
computed: {
|
||||||
/**
|
/**
|
||||||
* 处理运行结果数据,同时完成以下任务:
|
* 处理运行结果数据,同时完成以下任务:
|
||||||
@ -146,7 +146,9 @@ export default {
|
|||||||
const imagePattern = /data:image\/.*?;base64,.*/g;
|
const imagePattern = /data:image\/.*?;base64,.*/g;
|
||||||
const imageUrls = this.getFormattedContent()
|
const imageUrls = this.getFormattedContent()
|
||||||
.match(imagePattern)
|
.match(imagePattern)
|
||||||
?.map((dataUrl) => `<img src="${dataUrl}"><br>`);
|
?.map(
|
||||||
|
(dataUrl) => `<img src="${dataUrl}" style="max-width: 100%;"><br>`
|
||||||
|
);
|
||||||
|
|
||||||
if (!imageUrls) {
|
if (!imageUrls) {
|
||||||
return quickcommand.showMessageBox("dataUrl 格式不正确!");
|
return quickcommand.showMessageBox("dataUrl 格式不正确!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user