Skip to content

Commit

Permalink
perf(BackTop): 针对使用Transition进行优化
Browse files Browse the repository at this point in the history
  • Loading branch information
79E committed Dec 1, 2022
1 parent 19c7fd0 commit 0653e8e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion src/components/back-top/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { BackTop } from 'aunt';
| duration | 回到顶部所需时间(ms) | `number` | `400` |
| shape | 设置形状 | `'square' \| 'round'` | `square` |
| offset | BackTop 按钮偏移量 | `number \| string \| [number \| string, number \| string]` | `[20,40]` |
| transitionType | 置动画样式 可参考 transition 组件 | `string` | `-` |

## 事件

Expand Down
2 changes: 1 addition & 1 deletion src/components/back-top/back-top.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BackTop: FunctionComponent<BackTopProps> = props => {
};

return (
<Transition type={props.transitionType} in={visible} timeout={duration}>
<Transition in={visible} timeout={duration}>
<div className={joinTrim([ns.b(), props.className])} style={varStyle} onClick={scrollToTop}>
{renderContent()}
</div>
Expand Down
4 changes: 0 additions & 4 deletions src/components/back-top/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ export interface BackTopProps extends BaseTypeProps {
* @default [20,40]
*/
offset?: number | string | [number | string, number | string];
/**
* 设置动画样式 可参考 transition 组件
*/
transitionType?: string;
/**
* 点击按钮的回调函数
*/
Expand Down

0 comments on commit 0653e8e

Please sign in to comment.