Skip to content

Commit 545300e

Browse files
committed
feat: 修复了显示不全的问题
1 parent 6cfa09d commit 545300e

1 file changed

Lines changed: 32 additions & 2 deletions

File tree

src/components/WebOutput.vue

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</div>
2121

2222
<!-- 内容区域 -->
23-
<div class="flex-1 overflow-hidden relative min-h-screen">
23+
<div class="flex-1 overflow-auto relative">
2424
<!-- 加载状态 -->
2525
<div v-if="isRunning && !webContent" class="absolute inset-0 flex items-center justify-center bg-gray-50">
2626
<div class="text-center">
@@ -127,7 +127,37 @@ const processWebContent = async (content: string) => {
127127
const onFrameLoad = () => {
128128
if (webFrame.value?.contentDocument) {
129129
const style = webFrame.value.contentDocument.createElement('style')
130-
style.textContent = `body { margin: 0 !important; }`
130+
style.textContent = `
131+
body {
132+
margin: 0 !important;
133+
}
134+
135+
/* Webkit 滚动条美化 */
136+
::-webkit-scrollbar {
137+
width: 8px;
138+
height: 8px;
139+
}
140+
141+
::-webkit-scrollbar-track {
142+
background: #f1f1f1;
143+
border-radius: 4px;
144+
}
145+
146+
::-webkit-scrollbar-thumb {
147+
background: #888;
148+
border-radius: 4px;
149+
}
150+
151+
::-webkit-scrollbar-thumb:hover {
152+
background: #555;
153+
}
154+
155+
/* Firefox 滚动条美化 */
156+
* {
157+
scrollbar-width: thin;
158+
scrollbar-color: #888 #f1f1f1;
159+
}
160+
`
131161
webFrame.value.contentDocument.head.appendChild(style)
132162
}
133163
}

0 commit comments

Comments
 (0)