Skip to content

Commit

Permalink
fix(h5): 解决 AtNoticebar 组件在 web 端卡顿的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
robinv8 committed Dec 6, 2023
1 parent 2d34ac8 commit 3c07b6d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/taro-ui/src/components/noticebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class AtNoticebar extends React.Component<
animationData: {
actions: [{}]
},
dura: 15,
dura: 0,
isWEAPP: Taro.getEnv() === Taro.ENV_TYPE.WEAPP,
isALIPAY: Taro.getEnv() === Taro.ENV_TYPE.ALIPAY,
isWEB: Taro.getEnv() === Taro.ENV_TYPE.WEB
Expand Down Expand Up @@ -135,8 +135,13 @@ export default class AtNoticebar extends React.Component<
const innerClassName = ['at-noticebar__content-inner']
if (marquee) {
close = false
style['animation-duration'] = `${dura}s`
innerClassName.push(animElemId)
style['animation-delay'] = '3s'

if (dura > 0) {
style['animation-duration'] = `${dura}s`
style['animation-delay'] = '1s'
}
}

const classObject = {
Expand Down

0 comments on commit 3c07b6d

Please sign in to comment.