Skip to content

Commit 3ac661b

Browse files
committed
chore: force refresh playground editor on startup
1 parent d1bf35c commit 3ac661b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/sfc-playground/src/codemirror/CodeMirror.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,16 @@ onMounted(() => {
5555
editor.setOption('mode', props.mode)
5656
})
5757
58-
window.addEventListener('resize', debounce(() => {
58+
window.addEventListener(
59+
'resize',
60+
debounce(() => {
61+
editor.refresh()
62+
})
63+
)
64+
65+
setTimeout(() => {
5966
editor.refresh()
60-
}))
67+
}, 50)
6168
})
6269
</script>
6370

@@ -70,7 +77,7 @@ onMounted(() => {
7077
}
7178
7279
.CodeMirror {
73-
font-family: "Source Code Pro", monospace;
80+
font-family: 'Source Code Pro', monospace;
7481
height: 100%;
7582
}
7683
</style>

0 commit comments

Comments
 (0)