diff --git a/packages/lego/example/TableDemo/demo1.tsx b/packages/lego/example/TableDemo/demo1.tsx index f7cd1e8ef2..b59ef0ee95 100644 --- a/packages/lego/example/TableDemo/demo1.tsx +++ b/packages/lego/example/TableDemo/demo1.tsx @@ -89,7 +89,7 @@ export default () => { data={data} columns={columns} height={120} - countPreview={4} + pageSize={4} autoplay={true} /> ); diff --git a/packages/lego/example/TableDemo/demo2.tsx b/packages/lego/example/TableDemo/demo2.tsx index c38f81eeff..7b090755f1 100644 --- a/packages/lego/example/TableDemo/demo2.tsx +++ b/packages/lego/example/TableDemo/demo2.tsx @@ -74,7 +74,7 @@ export default () => { data={data} columns={columns} height={200} - countPreview={4} + pageSize={4} /> diff --git a/packages/lego/example/TableDemo/demo3.tsx b/packages/lego/example/TableDemo/demo3.tsx index 8122972753..a3625740db 100644 --- a/packages/lego/example/TableDemo/demo3.tsx +++ b/packages/lego/example/TableDemo/demo3.tsx @@ -63,7 +63,7 @@ export default () => { columns={columns} colors={['red', 'blue', 'green']} height={200} - countPreview={4} + pageSize={4} /> ); diff --git a/packages/lego/example/TableDemo/demo4.tsx b/packages/lego/example/TableDemo/demo4.tsx index 1c9aaecb31..b264ae203e 100644 --- a/packages/lego/example/TableDemo/demo4.tsx +++ b/packages/lego/example/TableDemo/demo4.tsx @@ -104,5 +104,5 @@ const columns = [ ]; export default () => { - return ; + return
; }; diff --git a/packages/lego/example/TableDemo/demo5.tsx b/packages/lego/example/TableDemo/demo5.tsx index 4d2a9aefb9..f83286da5d 100644 --- a/packages/lego/example/TableDemo/demo5.tsx +++ b/packages/lego/example/TableDemo/demo5.tsx @@ -98,7 +98,7 @@ export default () => { columns={columns} autoplay={false} height={200} - countPreview={4} + pageSize={4} /> ); }; diff --git a/packages/lego/example/TableDemo/demo6.tsx b/packages/lego/example/TableDemo/demo6.tsx index 78577fe42d..7faba9537b 100644 --- a/packages/lego/example/TableDemo/demo6.tsx +++ b/packages/lego/example/TableDemo/demo6.tsx @@ -107,7 +107,7 @@ export default () => { data={data} columns={columns} height={200} - countPreview={4} + pageSize={4} autoplay={false} headerClass="header" contentClass="content" diff --git a/packages/lego/src/table/index.md b/packages/lego/src/table/index.md index a876175dcb..21add6a816 100644 --- a/packages/lego/src/table/index.md +++ b/packages/lego/src/table/index.md @@ -16,7 +16,7 @@ group: | columns | `true` | 列数据 | `Column[]` | | | data | `true` | 数据源 | `T[]` | | | height | `true` | 除了表头的表格内容高度 | `number` | | -| countPreview | `true` | 每屏显示几条数据 | `number` | | +| pageSize | `true` | 每屏显示几条数据 | `number` | | | speed | `false` | 速度(ms) | `number` | | | autoplay | `false` | 自动轮播 | `boolean` | | | inModal | `false` | 是否在弹窗中 | `boolean` | | diff --git a/packages/lego/src/table/index.tsx b/packages/lego/src/table/index.tsx index 9682aec3a6..8093ed2f0e 100644 --- a/packages/lego/src/table/index.tsx +++ b/packages/lego/src/table/index.tsx @@ -30,7 +30,7 @@ export type CustomTableProps = { /** 容器高度 */ height: number; /** 每屏显示几条数据 */ - countPreview: number; + pageSize: number; /** 速度(ms) */ speed?: number; /** 自动轮播 */ @@ -49,7 +49,7 @@ function Table>({ columns = [], data = [], height, - countPreview = 1, + pageSize = 1, speed = 1000, autoplay = true, inModal = false, @@ -67,7 +67,7 @@ function Table>({ return { width }; }; - const slidesPerViewParams = countPreview > data.length ? data.length : countPreview; + const slidesPerViewParams = pageSize > data.length ? data.length : pageSize; const lineHeight = height / slidesPerViewParams; return ( @@ -116,7 +116,7 @@ function Table>({ >({ const Container = memo( ({ height, - countPreview, + pageSize, autoplay, speed, children, }: PropsWithChildren<{ height: number; - countPreview: number; + pageSize: number; autoplay: boolean; speed: number; }>) => { @@ -179,7 +179,7 @@ const Container = memo(