From 5295279a7682bec09db6a79dbfccd9e25c18d0f0 Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Sun, 25 Apr 2021 13:24:34 +0800 Subject: [PATCH] feat: resize add offse value --- components/vc-resize-observer/index.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/vc-resize-observer/index.jsx b/components/vc-resize-observer/index.jsx index 1dcdeebed..dbd031eb0 100644 --- a/components/vc-resize-observer/index.jsx +++ b/components/vc-resize-observer/index.jsx @@ -58,6 +58,7 @@ const VueResizeObserver = defineComponent({ handleResize(entries) { const { target } = entries[0]; const { width, height } = target.getBoundingClientRect(); + const { offsetWidth, offsetHeight } = target; /** * Resize observer trigger when content size changed. * In most case we just care about element size, @@ -67,7 +68,7 @@ const VueResizeObserver = defineComponent({ const fixedHeight = Math.floor(height); if (this.width !== fixedWidth || this.height !== fixedHeight) { - const size = { width: fixedWidth, height: fixedHeight }; + const size = { width: fixedWidth, height: fixedHeight, offsetWidth, offsetHeight }; this.width = fixedWidth; this.height = fixedHeight; this.__emit('resize', size);