chore(sfc-playground): fix autoresize

This commit is contained in:
Evan You 2021-09-17 09:48:17 -04:00
parent 0cfa2112ce
commit 51f74679ef

View File

@ -3,7 +3,11 @@ import Header from './Header.vue'
import { Repl, ReplStore } from '@vue/repl'
import { watchEffect } from 'vue'
document.documentElement.style.setProperty('--vh', window.innerHeight + `px`)
const setVH = () => {
document.documentElement.style.setProperty('--vh', window.innerHeight + `px`)
}
window.addEventListener('resize', setVH)
setVH()
const store = new ReplStore({
serializedState: location.hash.slice(1),
@ -18,7 +22,7 @@ watchEffect(() => history.replaceState({}, '', store.serialize()))
<template>
<Header :store="store" />
<Repl :store="store" :showCompileOutput="true" />
<Repl :store="store" :showCompileOutput="true" :autoResize="true" />
</template>
<style>