From 3592127f2648860e59fa19841317afcea88b1494 Mon Sep 17 00:00:00 2001 From: John Zhang Date: Mon, 11 Mar 2024 15:20:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=87=8D=E7=BD=AE=EF=BC=9A=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6input=EF=BC=8C=E6=B8=85=E9=99=A4HTML?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/image2code.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/static/image2code.js b/src/main/resources/static/image2code.js index 1637870..a6850eb 100644 --- a/src/main/resources/static/image2code.js +++ b/src/main/resources/static/image2code.js @@ -199,6 +199,11 @@ $(function (){ $(".preview-block").hide() $("#imagePreview").hide().attr("src","") iframe.src = iframe.src; + + // Clear html preview + accumulatedHtml = '' + // Reset the file input + document.getElementById('fileInput').value = '' }); -- Gitee From b2d9adebbd529a71da5e7547c240450e3ccaabff Mon Sep 17 00:00:00 2001 From: John Zhang Date: Mon, 11 Mar 2024 16:53:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?iframe=E9=A2=84=E8=A7=88=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=87=AA=E5=8A=A8=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/image2code.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/static/image2code.js b/src/main/resources/static/image2code.js index a6850eb..493cb21 100644 --- a/src/main/resources/static/image2code.js +++ b/src/main/resources/static/image2code.js @@ -53,6 +53,9 @@ function updateIframeContent() { doc.open(); doc.write(accumulatedHtml ); // 确保文档结构完整 doc.close(); + if (doc.body.scrollHeight) { + doc.body.scrollTo(0, doc.body.scrollHeight) + } } const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; -- Gitee From 2b18704e519a2b6c6a156f7b2ddc5408c9805917 Mon Sep 17 00:00:00 2001 From: John Zhang Date: Mon, 11 Mar 2024 16:55:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?vue=5Funiapp=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=8F=90=E7=A4=BA=E8=AF=8D=E4=BB=8D=E7=84=B6=E6=98=AF?= =?UTF-8?q?html=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/prompts/vue_uniapp.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/resources/prompts/vue_uniapp.txt b/src/main/resources/prompts/vue_uniapp.txt index 425d106..bfa4d6b 100644 --- a/src/main/resources/prompts/vue_uniapp.txt +++ b/src/main/resources/prompts/vue_uniapp.txt @@ -1,4 +1,4 @@ -You are an expert Vue/UniApp developer +You are an expert Vue/[UniApp](https://en.uniapp.dcloud.io/) developer. You take screenshots of a reference web page from the user, and then build single page apps using Vue and UniApp. - Make sure the app looks exactly like the screenshot. @@ -21,4 +21,8 @@ padding, margin, border, etc. Match the colors and sizes exactly. } } }).mount('#app') - \ No newline at end of file + + +Return only the full code in tags. +Do not include markdown "```" or "```html" at the start or end. +The return result must only include the code. \ No newline at end of file -- Gitee