Page和SeamlessScroll的children增加允许函数方式传入
parent
7c93e8a2b7
commit
2b86f53e95
|
|
@ -18,6 +18,7 @@ function Page(props) {
|
|||
contentPadding = "20px",
|
||||
customActionButtons,
|
||||
extraActionButtons,
|
||||
children
|
||||
} = props;
|
||||
|
||||
const [pageWidth, setPageWidth] = useState(window.innerWidth);
|
||||
|
|
@ -49,7 +50,7 @@ function Page(props) {
|
|||
<div className="page-layout" id="page-layout">
|
||||
{(isShowAllAction && isShowHeader) && <HeaderBack title={headerTitle} history={history} previous={headerPrevious} />}
|
||||
<div style={{ padding: contentPadding }}>
|
||||
{props.children}
|
||||
{children && typeof children === "function" ? children() : children}
|
||||
{
|
||||
(isShowAllAction && isShowFooter) && (
|
||||
<div className="page-layout-footer" style={{ position: "relative", zIndex: "9" }}>
|
||||
|
|
|
|||
|
|
@ -442,12 +442,12 @@ const SeamlessScroll = forwardRef((props, ref) => {
|
|||
return (
|
||||
<>
|
||||
<div ref={slotListRef} style={floatStyle}>
|
||||
{children}
|
||||
{children && typeof children === "function" ? children() : children}
|
||||
</div>
|
||||
{isScroll
|
||||
? Array.from({ length: copyNum }).map((_, index) => (
|
||||
<div key={`copy-${index}`} style={floatStyle}>
|
||||
{children}
|
||||
{children && typeof children === "function" ? children() : children}
|
||||
</div>
|
||||
))
|
||||
: null}
|
||||
|
|
|
|||
Loading…
Reference in New Issue