svelte/test/runtime/samples/window-event/main.svelte

8 lines
184 B

<script>
export let width;
export let height;
</script>
<svelte:window on:resize={function () { width = this.innerWidth, height = this.innerHeight; }}/>
<div>{width}x{height}</div>