Skip to content

Commit 79e6978

Browse files
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] <github-actions[bot]@users.noreply.github.com>
1 parent fecc35b commit 79e6978

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/notice-bar/notice-bar.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default class NoticeBar extends SuperComponent {
2626

2727
options: ComponentsOptionsType = {
2828
multipleSlots: true,
29+
pureDataPattern: /^__/,
2930
};
3031

3132
properties = props;
@@ -34,6 +35,7 @@ export default class NoticeBar extends SuperComponent {
3435
prefix,
3536
classPrefix: name,
3637
loop: -1,
38+
__ready: false,
3739
};
3840

3941
observers = {
@@ -50,6 +52,7 @@ export default class NoticeBar extends SuperComponent {
5052
},
5153

5254
visible(visible) {
55+
if (!this.data.__ready) return;
5356
if (visible) {
5457
this.show();
5558
} else {
@@ -68,6 +71,7 @@ export default class NoticeBar extends SuperComponent {
6871
},
6972

7073
content() {
74+
if (!this.data.__ready) return;
7175
this.clearNoticeBarAnimation();
7276
this.initAnimation();
7377
},
@@ -87,6 +91,7 @@ export default class NoticeBar extends SuperComponent {
8791

8892
ready() {
8993
this.show();
94+
this.setData({ __ready: true });
9095
},
9196
};
9297

0 commit comments

Comments
 (0)