From e8bd24265d6e36ed61ea353108d57d75602d2f08 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 19 Jun 2020 20:20:22 +0800 Subject: [PATCH] fix(NoticeBar): failed to replay --- src/notice-bar/index.js | 4 ++-- src/notice-bar/test/index.spec.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/notice-bar/index.js b/src/notice-bar/index.js index e6d7167b2..49d57c1c7 100644 --- a/src/notice-bar/index.js +++ b/src/notice-bar/index.js @@ -60,11 +60,11 @@ export default createComponent({ this.offset = this.wrapWidth; this.duration = 0; - doubleRaf(() => { + setTimeout(() => { this.offset = -this.contentWidth; this.duration = (this.contentWidth + this.wrapWidth) / this.speed; this.$emit('replay'); - }); + }, 100); }, reset() { diff --git a/src/notice-bar/test/index.spec.js b/src/notice-bar/test/index.spec.js index c86bebf70..68d0b4c4d 100644 --- a/src/notice-bar/test/index.spec.js +++ b/src/notice-bar/test/index.spec.js @@ -45,7 +45,7 @@ test('replay event', async () => { }); wrapper.find('.van-notice-bar__content').trigger('transitionend'); - await later(50); + await later(150); expect(wrapper.emitted('replay')).toBeTruthy(); });