Browse Source

Carousel: fix async item not refreshing view issue (#3159)

杨奕 8 năm trước cách đây
mục cha
commit
df46ca5c42
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      packages/carousel/src/main.vue

+ 2 - 2
packages/carousel/src/main.vue

@@ -96,8 +96,8 @@ export default {
   },
 
   watch: {
-    items() {
-      this.setActiveItem(0);
+    items(val) {
+      if (val.length > 0) this.setActiveItem(0);
     },
 
     activeIndex(val, oldVal) {