Skip to content

Commit 51f7467

Browse files
committed
chore(sfc-playground): fix autoresize
1 parent 0cfa211 commit 51f7467

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/sfc-playground/src/App.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import Header from './Header.vue'
33
import { Repl, ReplStore } from '@vue/repl'
44
import { watchEffect } from 'vue'
55
6-
document.documentElement.style.setProperty('--vh', window.innerHeight + `px`)
6+
const setVH = () => {
7+
document.documentElement.style.setProperty('--vh', window.innerHeight + `px`)
8+
}
9+
window.addEventListener('resize', setVH)
10+
setVH()
711
812
const store = new ReplStore({
913
serializedState: location.hash.slice(1),
@@ -18,7 +22,7 @@ watchEffect(() => history.replaceState({}, '', store.serialize()))
1822

1923
<template>
2024
<Header :store="store" />
21-
<Repl :store="store" :showCompileOutput="true" />
25+
<Repl :store="store" :showCompileOutput="true" :autoResize="true" />
2226
</template>
2327

2428
<style>

0 commit comments

Comments
 (0)