Skip to content

Commit 3c07b6d

Browse files
committed
fix(h5): 解决 AtNoticebar 组件在 web 端卡顿的问题
#1714
1 parent 2d34ac8 commit 3c07b6d

File tree

1 file changed

+7
-2
lines changed
  • packages/taro-ui/src/components/noticebar

1 file changed

+7
-2
lines changed

packages/taro-ui/src/components/noticebar/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default class AtNoticebar extends React.Component<
2525
animationData: {
2626
actions: [{}]
2727
},
28-
dura: 15,
28+
dura: 0,
2929
isWEAPP: Taro.getEnv() === Taro.ENV_TYPE.WEAPP,
3030
isALIPAY: Taro.getEnv() === Taro.ENV_TYPE.ALIPAY,
3131
isWEB: Taro.getEnv() === Taro.ENV_TYPE.WEB
@@ -135,8 +135,13 @@ export default class AtNoticebar extends React.Component<
135135
const innerClassName = ['at-noticebar__content-inner']
136136
if (marquee) {
137137
close = false
138-
style['animation-duration'] = `${dura}s`
139138
innerClassName.push(animElemId)
139+
style['animation-delay'] = '3s'
140+
141+
if (dura > 0) {
142+
style['animation-duration'] = `${dura}s`
143+
style['animation-delay'] = '1s'
144+
}
140145
}
141146

142147
const classObject = {

0 commit comments

Comments
 (0)