Sha256: 82ab548c174a61833e5ad4ac2b64ec5df69a8ac888c699182469ded9bee4ca62
Contents?: true
Size: 490 Bytes
Versions: 17
Compression:
Stored size: 490 Bytes
Contents
export default function sizeObserver() { return { observedWidth: 0, observedHeight: 0, init() { const ro = new ResizeObserver((entries) => { const rect = entries[0].contentRect; this.observedWidth = Math.round(rect.width); this.observedHeight = Math.round(rect.height); }); ro.observe(this.$el); this.observedWidth = Math.round(this.$el.clientWidth); this.observedHeight = Math.round(this.$el.clientHeight); }, }; }
Version data entries
17 entries across 17 versions & 1 rubygems