mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-23 18:50:06 +08:00
feat: init
This commit is contained in:
parent
10bff9cfa2
commit
7fab35b535
@ -150,7 +150,7 @@ const GlobalLayout: React.FC = () => {
|
||||
() => ({
|
||||
algorithm: getAlgorithm(theme),
|
||||
token: { motion: !theme.includes('motion-off') },
|
||||
cssVar: true,
|
||||
cssVar: false,
|
||||
hashed: false,
|
||||
}),
|
||||
[theme],
|
||||
|
7
components/table/demo/header-table.md
Normal file
7
components/table/demo/header-table.md
Normal file
@ -0,0 +1,7 @@
|
||||
## zh-CN
|
||||
|
||||
调试使用。
|
||||
|
||||
## en-US
|
||||
|
||||
debug use.
|
53
components/table/demo/header-table.tsx
Normal file
53
components/table/demo/header-table.tsx
Normal 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;
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user