Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui-react
提交
ea66e468
N
nutui-react
项目概览
京东前端
/
nutui-react
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui-react
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
ea66e468
编写于
12月 09, 2022
作者:
V
vickyYe
提交者:
GitHub
12月 09, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: noticebar纵向滚动渲染慢问题修复,设置高度小于默认值时动效失效问题修复 (#528)
上级
c42beb08
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
18 deletion
+36
-18
src/packages/noticebar/demo.tsx
src/packages/noticebar/demo.tsx
+1
-0
src/packages/noticebar/noticebar.scss
src/packages/noticebar/noticebar.scss
+0
-1
src/packages/noticebar/noticebar.taro.tsx
src/packages/noticebar/noticebar.taro.tsx
+17
-7
src/packages/noticebar/noticebar.tsx
src/packages/noticebar/noticebar.tsx
+18
-10
未找到文件。
src/packages/noticebar/demo.tsx
浏览文件 @
ea66e468
...
...
@@ -85,6 +85,7 @@ const NoticeBarDemo = () => {
list
=
{
horseLamp1
}
speed
=
{
10
}
standTime
=
{
1000
}
height
=
{
30
}
onClick
=
{
(
e
)
=>
{
go
(
e
.
target
.
innerHTML
)
}
}
...
...
src/packages/noticebar/noticebar.scss
浏览文件 @
ea66e468
...
...
@@ -116,7 +116,6 @@
padding
:
0
;
display
:
block
;
flex
:
1
;
.horseLamp_list_item
{
display
:
flex
;
align-items
:
center
;
...
...
src/packages/noticebar/noticebar.taro.tsx
浏览文件 @
ea66e468
...
...
@@ -201,19 +201,24 @@ export const NoticeBar: FunctionComponent<
*/
const
startRollEasy
=
()
=>
{
showhorseLamp
()
const
timerCurr
=
setInterval
(
showhorseLamp
,
~~
(
height
/
speed
/
4
)
*
1000
+
Number
(
standTime
)
)
const
time
=
height
/
speed
/
4
<
1
?
Number
((
height
/
speed
/
4
).
toFixed
(
1
))
*
1000
:
~~
(
height
/
speed
/
4
)
*
1000
const
timerCurr
=
setInterval
(
showhorseLamp
,
time
+
Number
(
standTime
))
SetTimer
(
timerCurr
)
}
const
showhorseLamp
=
()
=>
{
SetAnimate
(
true
)
const
time
=
height
/
speed
/
4
<
1
?
Number
((
height
/
speed
/
4
).
toFixed
(
1
))
*
1000
:
~~
(
height
/
speed
/
4
)
*
1000
setTimeout
(()
=>
{
scrollList
.
current
.
push
(
scrollList
.
current
[
0
])
scrollList
.
current
.
shift
()
SetAnimate
(
false
)
},
~~
(
height
/
speed
/
4
)
*
1000
)
},
time
)
}
const
startRoll
=
()
=>
{
...
...
@@ -283,11 +288,16 @@ export const NoticeBar: FunctionComponent<
height
:
direction
===
'
vertical
'
?
`
${
height
}
px`
:
''
,
}
const
duringTime
=
~~
(
height
/
speed
/
4
)
const
duringTime
=
height
/
speed
/
4
<
1
?
Number
((
height
/
speed
/
4
).
toFixed
(
1
))
:
~~
(
height
/
speed
/
4
)
const
noDuring
=
height
/
speed
<
1
?
(
height
/
speed
).
toFixed
(
1
)
:
~~
(
height
/
speed
)
const
horseLampStyle
=
{
transform
:
complexAm
?
`translateY(
${
distance
}
px)`
:
''
,
transition
:
animate
?
`all
${
duringTime
===
0
?
~~
(
height
/
speed
)
:
duringTime
}
s`
?
`all
${
duringTime
===
0
?
noDuring
:
duringTime
}
s`
:
''
,
marginTop
:
animate
?
`-
${
height
}
px`
:
''
,
}
...
...
src/packages/noticebar/noticebar.tsx
浏览文件 @
ea66e468
...
...
@@ -199,19 +199,24 @@ export const NoticeBar: FunctionComponent<
*/
const
startRollEasy
=
()
=>
{
showhorseLamp
()
const
timerCurr
=
setInterval
(
showhorseLamp
,
~~
(
height
/
speed
/
4
)
*
1000
+
Number
(
standTime
)
)
const
time
=
height
/
speed
/
4
<
1
?
Number
((
height
/
speed
/
4
).
toFixed
(
1
))
*
1000
:
~~
(
height
/
speed
/
4
)
*
1000
const
timerCurr
=
setInterval
(
showhorseLamp
,
time
+
Number
(
standTime
))
SetTimer
(
timerCurr
)
}
const
showhorseLamp
=
()
=>
{
SetAnimate
(
true
)
const
time
=
height
/
speed
/
4
<
1
?
Number
((
height
/
speed
/
4
).
toFixed
(
1
))
*
1000
:
~~
(
height
/
speed
/
4
)
*
1000
setTimeout
(()
=>
{
scrollList
.
current
.
push
(
scrollList
.
current
[
0
])
scrollList
.
current
.
shift
()
SetAnimate
(
false
)
},
~~
(
height
/
speed
/
4
)
*
1000
)
},
time
)
}
const
startRoll
=
()
=>
{
...
...
@@ -281,11 +286,16 @@ export const NoticeBar: FunctionComponent<
height
:
direction
===
'
vertical
'
?
`
${
height
}
px`
:
''
,
}
const
duringTime
=
~~
(
height
/
speed
/
4
)
const
duringTime
=
height
/
speed
/
4
<
1
?
Number
((
height
/
speed
/
4
).
toFixed
(
1
))
:
~~
(
height
/
speed
/
4
)
const
noDuring
=
height
/
speed
<
1
?
(
height
/
speed
).
toFixed
(
1
)
:
~~
(
height
/
speed
)
const
horseLampStyle
=
{
transform
:
complexAm
?
`translateY(
${
distance
}
px)`
:
''
,
transition
:
animate
?
`all
${
duringTime
===
0
?
~~
(
height
/
speed
)
:
duringTime
}
s`
?
`all
${
duringTime
===
0
?
noDuring
:
duringTime
}
s`
:
''
,
marginTop
:
animate
?
`-
${
height
}
px`
:
''
,
}
...
...
@@ -343,9 +353,7 @@ export const NoticeBar: FunctionComponent<
)
:
null
}
</
div
>
)
:
null
}
{
showNoticeBar
&&
scrollList
.
current
.
length
>
0
&&
direction
===
'
vertical
'
?
(
{
showNoticeBar
&&
direction
===
'
vertical
'
?
(
<
div
className
=
"nut-noticebar-vertical"
style
=
{
barStyle
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录