@pisell/layout
Version:
基于 Fusion 设计系统的自然布局体系
35 lines • 994 B
JavaScript
import React, { useContext, forwardRef } from 'react';
import classNames from 'classnames';
import Context from "./common/context";
/**
* 自由节点
*/
var FixedPoint = function FixedPoint(props, ref) {
var children = props.children,
_props$left = props.left,
left = _props$left === void 0 ? 0 : _props$left,
_props$top = props.top,
top = _props$top === void 0 ? 0 : _props$top,
className = props.className,
zIndex = props.zIndex;
var _useContext = useContext(Context),
prefix = _useContext.prefix;
return /*#__PURE__*/React.createElement("div", {
ref: ref,
style: {
width: 2,
height: 2,
position: 'relative'
},
className: classNames(prefix + "float", className)
}, /*#__PURE__*/React.createElement("div", {
style: {
position: 'absolute',
zIndex: zIndex,
left: left,
top: top
}
}, children));
};
FixedPoint.displayName = 'FixedPoint';
export default /*#__PURE__*/forwardRef(FixedPoint);