You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/packages/svelte/tests/runtime-browser/samples/binding-width-height-this-t.../main.svelte

24 lines
324 B

<script>
import { log } from './log.js';
let w = 0;
let h = 0;
/** @type {HTMLElement} */
let div;
$: {
log.push([!!div, w, h]);
}
</script>
<div bind:this={div} bind:clientWidth={w} bind:clientHeight={h} class="box"></div>
<style>
.box {
width: 100px;
height: 100px;
background: #ff3e00;
}
</style>