From 2c39273cc63723716a84989e33228de7a95f6875 Mon Sep 17 00:00:00 2001 From: Cherry7 <79909910+CCherry07@users.noreply.github.com> Date: Sat, 29 Jul 2023 12:18:58 +0800 Subject: [PATCH] fix: autoplay (#6771) close #6768 --- components/vc-slick/inner-slider.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/vc-slick/inner-slider.jsx b/components/vc-slick/inner-slider.jsx index f55c4e0ee..2d9245d81 100644 --- a/components/vc-slick/inner-slider.jsx +++ b/components/vc-slick/inner-slider.jsx @@ -51,6 +51,15 @@ export default { }; }, watch: { + autoplay(newValue, oldValue) { + if (!oldValue && newValue) { + this.handleAutoPlay('playing'); + } else if (newValue) { + this.handleAutoPlay('update'); + } else { + this.pause('paused'); + } + }, __propsSymbol__() { const nextProps = this.$props; const spec = {