feat: init

This commit is contained in:
叶枫 2024-08-09 09:30:56 +08:00
parent 10bff9cfa2
commit 7fab35b535
5 changed files with 63 additions and 1 deletions

View File

@ -150,7 +150,7 @@ const GlobalLayout: React.FC = () => {
() => ({
algorithm: getAlgorithm(theme),
token: { motion: !theme.includes('motion-off') },
cssVar: true,
cssVar: false,
hashed: false,
}),
[theme],

View File

@ -0,0 +1,7 @@
## zh-CN
调试使用。
## en-US
debug use.

View File

@ -0,0 +1,53 @@
import React from 'react';
import type { TableProps } from 'antd';
import { Table } from 'antd';
const HeaderTable = (props: { style?: React.CSSProperties; children?: React.ReactNode }) => (
<>
<div style={{ left: 0, position: 'sticky' }}>
<div
style={{
padding: 8,
display: 'flex',
justifyContent: 'space-between',
}}
>
<div></div>
<div></div>
</div>
</div>
<table {...props} />
</>
);
const _tableProps: TableProps = {
columns: [
{ title: 'Name1', width: 1600, dataIndex: 'name' },
{ title: 'Name2', dataIndex: 'name' },
{ title: 'Name3', dataIndex: 'name' },
{ title: 'Name4', dataIndex: 'name' },
{ title: 'Name5', dataIndex: 'name' },
],
dataSource: [
{ key: '1', name: 'John Brown' },
{ key: '2', name: 'Jim Green' },
{ key: '3', name: 'Joe Black' },
],
scroll: { x: 'max-content' },
sticky: true,
components: { header: { table: HeaderTable } },
};
const App = () => (
<div style={{ padding: 20 }}>
<Table {..._tableProps} />
<Table
{..._tableProps}
columns={[
...(_tableProps.columns || []),
{ title: 'Name5', fixed: 'right', dataIndex: 'name' },
]}
/>
</div>
);
export default App;

View File

@ -109,6 +109,7 @@ const columns = [
<code src="./demo/dynamic-settings.tsx">Dynamic Settings</code>
<code src="./demo/selections-debug.tsx" debug>selections with icon</code>
<code src="./demo/component-token.tsx" debug>Component Token</code>
<code src="./demo/header-table.tsx" debug>header table</code>
## API

View File

@ -110,6 +110,7 @@ const columns = [
<code src="./demo/dynamic-settings.tsx">动态控制表格属性</code>
<code src="./demo/selections-debug.tsx" debug>带下拉箭头的表头</code>
<code src="./demo/component-token.tsx" debug>组件 Token</code>
<code src="./demo/header-table.tsx" debug>头部表格</code>
## API