Skip to content

Commit 98fa2c7

Browse files
committed
fix: format
1 parent 9744ce0 commit 98fa2c7

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/packages/backtop/backtop.taro.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@ export const BackTop: FunctionComponent<
3030
}
3131
const classPrefix = 'nut-backtop'
3232
const [backTop, SetBackTop] = useState(false)
33-
const cls = classNames(
34-
classPrefix,
35-
{
36-
show: backTop,
37-
},
38-
className
39-
)
33+
const cls = classNames(classPrefix, { show: backTop }, className)
4034
// 监听用户滑动页面事件
4135
usePageScroll((res) => {
4236
const { scrollTop } = res

src/packages/backtop/backtop.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,7 @@ export const BackTop: FunctionComponent<
5151
const [scrollTop, SetScrollTop] = useState(0)
5252
let startTime = 0
5353
const scrollEl = useRef<any>(null)
54-
const cls = classNames(
55-
classPrefix,
56-
{
57-
show: backTop,
58-
},
59-
className
60-
)
54+
const cls = classNames(classPrefix, { show: backTop }, className)
6155

6256
const scrollListener = useCallback(() => {
6357
let top = null

0 commit comments

Comments
 (0)