使用方式
<Resizeable
showGuideLine
direction={["right", "bottom"]}
enableResizing
getGuideLineParent={() => document.body}
>
<div style={{ width: "80%", margin: "10px 0", background: "yellow" }}>
test
</div>
</Resizeable>
API
interface ResizeableProps {
direction?: DirectionType | Array<DirectionType>;
showGuideLine?: boolean;
getGuideLineParent?: (currDom: HTMLElement) => any;
onResizeEnd?: (
resizedX: number,
resizedY: number,
initWidth: number,
initHeight: number,
currDom: HTMLElement
) => void;
enableResizing?: boolean;
enableAutoResize?: boolean;
children?: React.ReactNode;
}