Skip to content

Commit 5295279

Browse files
committed
feat: resize add offse value
1 parent 184f6ca commit 5295279

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/vc-resize-observer/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const VueResizeObserver = defineComponent({
5858
handleResize(entries) {
5959
const { target } = entries[0];
6060
const { width, height } = target.getBoundingClientRect();
61+
const { offsetWidth, offsetHeight } = target;
6162
/**
6263
* Resize observer trigger when content size changed.
6364
* In most case we just care about element size,
@@ -67,7 +68,7 @@ const VueResizeObserver = defineComponent({
6768
const fixedHeight = Math.floor(height);
6869

6970
if (this.width !== fixedWidth || this.height !== fixedHeight) {
70-
const size = { width: fixedWidth, height: fixedHeight };
71+
const size = { width: fixedWidth, height: fixedHeight, offsetWidth, offsetHeight };
7172
this.width = fixedWidth;
7273
this.height = fixedHeight;
7374
this.__emit('resize', size);

0 commit comments

Comments
 (0)