fix: delay might be undefined

This commit is contained in:
chenjiahan
2020-05-30 21:41:46 +08:00
committed by neverland
parent d21420b7d2
commit 8ec96da204
+4 -2
View File
@@ -1,4 +1,4 @@
import { createNamespace } from '../utils'; import { createNamespace, isDef } from '../utils';
import { doubleRaf } from '../utils/dom/raf'; import { doubleRaf } from '../utils/dom/raf';
import Icon from '../icon'; import Icon from '../icon';
@@ -75,6 +75,8 @@ export default createComponent({
}, },
start() { start() {
const delay = isDef(this.delay) ? this.delay * 1000 : 0;
this.reset(); this.reset();
setTimeout(() => { setTimeout(() => {
@@ -94,7 +96,7 @@ export default createComponent({
this.contentWidth = contentWidth; this.contentWidth = contentWidth;
}); });
} }
}, this.delay * 1000); }, delay);
}, },
}, },