xy-resizable
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

使用方式

<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>;
  // 显示resize指导线
  showGuideLine?: boolean;
  // 指定resize指导线挂载的dom元素
  getGuideLineParent?: (currDom: HTMLElement) => any;
  onResizeEnd?: (
    resizedX: number,
    resizedY: number,
    initWidth: number,
    initHeight: number,
    currDom: HTMLElement
  ) => void;
  // 是否resize的同时修改dom size
  enableResizing?: boolean; // enableResizing 开启时,enableAutoResize也将为true
  enableAutoResize?: boolean; // 是否resize后直接修改style生效 默认为true

  children?: React.ReactNode;
}

Readme

Keywords

Package Sidebar

Install

npm i xy-resizable

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

17.6 kB

Total Files

5

Last publish

Collaborators

  • zxyty