Skip to content

Commit

Permalink
fix(ProTable): 导出组件类型及文档调整
Browse files Browse the repository at this point in the history
  • Loading branch information
yaob421123 committed Apr 21, 2023
1 parent ba9ced3 commit 0c2fbd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 44 deletions.
47 changes: 3 additions & 44 deletions packages/components/src/ProTable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ function Demo1() {

return (
<ProTable
// 搜索栏按钮
// 搜索栏按钮
bordered
searchBtns={[
{
label: '搜索',
Expand Down Expand Up @@ -110,49 +111,6 @@ export default Demo1

```

> 表单根据columns配置的key作为唯一值,如果配置表单props里面不写key,则继承columns列key
```jsx
import React from 'react';
import { ProTable } from '@uiw-admin/components';
const Demo1 = ()=> {
return (
<ProTable
columns={[
// input key 继承 column的key name
{
title: '名字',
key: 'name',
props: {
widget: 'input',
initialValue: '',
widgetProps: {
preIcon: 'tag',
placeholder: '输入用户名',
},
},
},
// 自定义表单key
{
title: '年龄',
key: 'registered',
props: {
widget: 'select',
key: 'age',
option: [
{ label: '20', value: 20 },
{ label: '10', value: 10 },
],
},
},
]}
/>
)
}

export default Demo1
```

### 显示操作栏

> 操作栏区域默认是`Button`按钮,可通过`render`自定义
Expand Down Expand Up @@ -700,6 +658,7 @@ export default Demo6
| tableBackgroundColor | 网格中表格的背景色 | React.CSSProperties['backgroundColor'] | - |
| tableHeadHidden | 网格中表头是否显示 | boolean | false |

更多属性文档请参考 [uiw/Table](https://uiwjs.github.io/#/components/table)

### searchBtns

Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/ProTable/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@

.uiw-protable-form .w-select {
background-color: transparent;
}

.uiw-admin-protable .w-table > table {
border-top: 1px solid #e8e8e8;
}
2 changes: 2 additions & 0 deletions packages/components/src/ProTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { StoreCtx } from './hooks';
import { ProtableProps } from './types';
import './index.css';

export * from './types';

const ProTabel: React.FC<ProtableProps> = (props) => {
const {
table,
Expand Down

0 comments on commit 0c2fbd9

Please sign in to comment.