Browse Source

feat: resize add offse value

pull/4001/head
tanjinzhou 4 years ago
parent
commit
5295279a76
  1. 3
      components/vc-resize-observer/index.jsx

3
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);

Loading…
Cancel
Save