@/utils#getSheetComponentOptions TypeScript Examples
The following examples show how to use
@/utils#getSheetComponentOptions.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx From S2 with MIT License | 5 votes |
BaseSheet = React.forwardRef(
(props: SheetComponentsProps, ref: React.MutableRefObject<SpreadSheet>) => {
const { dataCfg, options, header, showPagination } = props;
const { s2Ref, loading, containerRef, pagination, wrapperRef } =
useSpreadSheet(props);
// 同步实例
React.useEffect(() => {
if (ref) {
ref.current = s2Ref.current;
}
}, [ref, s2Ref]);
return (
<React.StrictMode>
<Spin spinning={loading} wrapperClassName={`${S2_PREFIX_CLS}-spin`}>
<div ref={wrapperRef} className={`${S2_PREFIX_CLS}-wrapper`}>
{header && (
<Header
{...header}
sheet={s2Ref.current}
width={options.width}
dataCfg={getSafetyDataConfig(dataCfg)}
options={getSheetComponentOptions(options)}
/>
)}
<div ref={containerRef} className={`${S2_PREFIX_CLS}-container`} />
{showPagination && (
<S2Pagination
{...pagination}
pagination={options.pagination}
onChange={get(showPagination, 'onChange')}
onShowSizeChange={get(showPagination, 'onShowSizeChange')}
/>
)}
</div>
</Spin>
</React.StrictMode>
);
},
)