zent
Version:
一套前端设计语言和基于React的实现
30 lines (26 loc) • 538 B
text/typescript
import { IPositionFunction } from '../position-function';
import { prefix } from './prefix';
/**
* ---------------
* | anchor |
* | |
* ---------------
* | popover |
* ---------------
*/
export const BottomSameWidth: IPositionFunction = ({
relativeRect,
cushion,
}) => {
const { width, bottom, left } = relativeRect;
const y = bottom + cushion;
return {
style: {
position: 'absolute',
left,
top: y,
width,
},
className: prefix('position-same-width'),
};
};