From 79e697880a73928f2eced3b3aa9c9a717a270dae Mon Sep 17 00:00:00 2001 From: jby0107 <50822648+jby0107@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:22:33 +0800 Subject: [PATCH] Fix/notice bar/unexpected animation (#3008) * fix(notice-bar): fix the problem of non-expected translate animation issue: when entering the page, occasionally a translteX animation is initiated when the content of the notice-bar actually wraps and fits in the notice bar #3077 * fix(notice-bar): update snap * chore: update snapshot * fix(notice-bar): 'ready' changed to pure data --------- Co-authored-by: github-actions[bot] --- src/notice-bar/notice-bar.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/notice-bar/notice-bar.ts b/src/notice-bar/notice-bar.ts index 430eb69c3..a81b3ebc8 100644 --- a/src/notice-bar/notice-bar.ts +++ b/src/notice-bar/notice-bar.ts @@ -26,6 +26,7 @@ export default class NoticeBar extends SuperComponent { options: ComponentsOptionsType = { multipleSlots: true, + pureDataPattern: /^__/, }; properties = props; @@ -34,6 +35,7 @@ export default class NoticeBar extends SuperComponent { prefix, classPrefix: name, loop: -1, + __ready: false, }; observers = { @@ -50,6 +52,7 @@ export default class NoticeBar extends SuperComponent { }, visible(visible) { + if (!this.data.__ready) return; if (visible) { this.show(); } else { @@ -68,6 +71,7 @@ export default class NoticeBar extends SuperComponent { }, content() { + if (!this.data.__ready) return; this.clearNoticeBarAnimation(); this.initAnimation(); }, @@ -87,6 +91,7 @@ export default class NoticeBar extends SuperComponent { ready() { this.show(); + this.setData({ __ready: true }); }, };