一个用于React的可调整大小组件。
一个用于 React 的可调整大小组件。
$ npm install --save re-resizabledefaultSize 的示例import { Resizable } from 're-resizable';
<Resizable
defaultSize={{
width: 320,
height: 200,
}}
>
Sample with default size
</Resizable>如果你只想设置宽度,只需提供宽度属性即可。 The height property will automatically be set to auto, which means it will adjust 100% of its parent's height:
import { Resizable } from 're-resizable';
<Resizable
defaultSize={{
width: 320
}}
>
Sample with default size
</Resizable>size如果你使用 size 属性,请自行管理状态。
import { Resizable } from 're-resizable';
<Resizable
size={{ width: this.state.width, height: this.state.height }}
onResizeStop={(e, direction, ref, d) => {
this.setState({
width: this.state.width + d.width,
height: this.state.height + d.height,
});
}}
>
Sample with size
</Resizable>defaultSize?: { width?: (number | string), height?: (number | string) };指定拖拽项应起始的width和height。
为了考试
暂无开放 Issues,或尚未同步最近议题。