Skip to content

Commit

Permalink
docs: improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Barrior committed Oct 28, 2024
1 parent 9c84534 commit 17f23fb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/search-table-react/001-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ const Demo = () => {
ref={STableRef}
search={{ schema, labelWidth: 80 }}
title={{
// 显示列设置
// 显示刷新按钮
showRefresh: true,
// 显示列设置按钮
showSetting: true,
// 标签页
tabs: {
Expand Down
42 changes: 42 additions & 0 deletions examples/search-table-react/050-tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,45 @@ const Demo = () => {

export default Demo
```

## 自定义两侧内容(无标签情况)

使用 Antd Tabs 自带的 `tabBarExtraContent` 属性实现,下划线样式请按需删除。

```tsx
import { sleep } from '@examples/utils'
import schema from './helpers/schema'
import columns from './helpers/columns'
import createDataSource from './helpers/createDataSource'
import SearchTable from '@schema-render/search-table-react'
import { Button } from 'antd'

const Demo = () => {
const tabBarExtraContent = {
left: <Button>左侧内容</Button>,
right: <Button>右侧内容</Button>,
}

return (
<SearchTable
search={{ schema, labelWidth: 80 }}
title={{
showRefresh: true,
showSetting: true,
tabs: {
tabBarExtraContent,
},
}}
table={{ columns }}
request={async (searchParams) => {
// 模拟请求接口获取表格数据
await sleep()
const data = createDataSource(searchParams.pageSize)
return { data, total: 100 }
}}
/>
)
}

export default Demo
```
1 change: 1 addition & 0 deletions examples/search-table-react/700-locale.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Demo = () => {
labelWidth: 'max-content',
}}
title={{
showRefresh: true,
showSetting: true,
}}
table={{
Expand Down

0 comments on commit 17f23fb

Please sign in to comment.