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