From 2615bc54dd18d363e402218cc3ac714a6b9ee364 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 8 Nov 2020 16:36:18 +0800 Subject: [PATCH] fix(NoticeBar): can't replay in iOS14 (#7516) --- src/notice-bar/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/notice-bar/index.js b/src/notice-bar/index.js index 7c2784ff7..e074f1239 100644 --- a/src/notice-bar/index.js +++ b/src/notice-bar/index.js @@ -1,5 +1,5 @@ import { createNamespace, isDef } from '../utils'; -import { doubleRaf } from '../utils/dom/raf'; +import { doubleRaf, raf } from '../utils/dom/raf'; import { BindEventMixin } from '../mixins/bind-event'; import Icon from '../icon'; @@ -70,7 +70,8 @@ export default createComponent({ this.duration = 0; // wait for Vue to render offset - this.$nextTick(() => { + // using nextTick won't work in iOS14 + raf(() => { // use double raf to ensure animation can start doubleRaf(() => { this.offset = -this.contentWidth;