Skip to content

Commit

Permalink
Merge pull request #2476 from XiaoMi/hotfix/update-doc
Browse files Browse the repository at this point in the history
chore: 优化组件示例
  • Loading branch information
solarjoker authored May 9, 2023
2 parents 01b40a0 + f4179e8 commit d4c0b21
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
21 changes: 20 additions & 1 deletion packages/ui/back-top/stories/basic.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react'
import Tooltip from '@hi-ui/tooltip'
import { ArrowUpOutlined } from '@hi-ui/icons'
import BackTop from '../src'

/**
Expand Down Expand Up @@ -27,7 +29,24 @@ export const Basic = () => {
</div>
</div>
</div>
<BackTop />
<BackTop>
<Tooltip title="回到顶部" placement="left" disabledPortal={true}>
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
width: 40,
height: 40,
borderRadius: '50%',
color: '#fff',
background: '#237ffa',
}}
>
<ArrowUpOutlined />
</div>
</Tooltip>
</BackTop>
</>
)
}
2 changes: 1 addition & 1 deletion packages/ui/table/stories/col-menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const ColMenu = () => {
key: 2,
width: 80,
sorter(pre, next) {
return pre.age - next.age
return pre.raw.age - next.raw.age
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/table/stories/custom-filter.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const CustomFilter = () => {
key: 2,
width: 80,
sorter(pre, next) {
return pre.age - next.age
return pre.raw.age - next.raw.age
},
},
{
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/table/stories/setting-drawer.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react'
import Button from '@hi-ui/button'
import Table, { SettingDrawer as TableSettingDrawer } from '../src'
import Table, { SettingDrawer } from '../src'

/**
* @title 设置抽屉
*/
export const SettingDrawer = () => {
export const TableSettingDrawer = () => {
const [dataSource] = React.useState([
{
name: '小米9',
Expand Down Expand Up @@ -253,7 +253,7 @@ export const SettingDrawer = () => {
<Button onClick={() => setVisible(true)}>打开 setting 抽屉</Button>
</div>
<Table columns={columns} data={dataSource} />
<TableSettingDrawer
<SettingDrawer
visible={visible}
onClose={() => setVisible(false)}
drawerProps={{ width: 400, title: '字段设置' }}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/table/stories/virtual.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const Virtual = () => {
return (
<>
<h1>Width for Table</h1>
<div className="table-width__wrap" style={{ width: 800, background: '#fff' }}>
<div className="table-width__wrap" style={{ minWidth: 660, background: '#fff' }}>
<Table
fieldKey="name"
columns={column}
Expand Down

0 comments on commit d4c0b21

Please sign in to comment.