mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(NoticeBar): can't replay in iOS14 (#7516)
This commit is contained in:
parent
d59a17c5e1
commit
2615bc54dd
@ -1,5 +1,5 @@
|
|||||||
import { createNamespace, isDef } from '../utils';
|
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 { BindEventMixin } from '../mixins/bind-event';
|
||||||
import Icon from '../icon';
|
import Icon from '../icon';
|
||||||
|
|
||||||
@ -70,7 +70,8 @@ export default createComponent({
|
|||||||
this.duration = 0;
|
this.duration = 0;
|
||||||
|
|
||||||
// wait for Vue to render offset
|
// wait for Vue to render offset
|
||||||
this.$nextTick(() => {
|
// using nextTick won't work in iOS14
|
||||||
|
raf(() => {
|
||||||
// use double raf to ensure animation can start
|
// use double raf to ensure animation can start
|
||||||
doubleRaf(() => {
|
doubleRaf(() => {
|
||||||
this.offset = -this.contentWidth;
|
this.offset = -this.contentWidth;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user