From 8f4e2cf0c3cf675ac3748783203424f18994dbb9 Mon Sep 17 00:00:00 2001 From: Rijn Date: Mon, 16 Jan 2017 18:02:51 -0600 Subject: [PATCH] update pos when slot changes. added remove test --- src/components/carousel/carousel-item.vue | 5 +++++ src/components/carousel/carousel.vue | 2 ++ test/routers/carousel.vue | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/carousel/carousel-item.vue b/src/components/carousel/carousel-item.vue index 9bf04afc..929ffb0d 100644 --- a/src/components/carousel/carousel-item.vue +++ b/src/components/carousel/carousel-item.vue @@ -22,5 +22,10 @@ } } }, + compiled () { + // this.$parent.slotChange(); + // this.$parent.updateSlides(true, true); + // this.$parent.updatePos(); + } }; diff --git a/src/components/carousel/carousel.vue b/src/components/carousel/carousel.vue index dd7fd602..b4ce57e3 100644 --- a/src/components/carousel/carousel.vue +++ b/src/components/carousel/carousel.vue @@ -125,6 +125,8 @@ }); this.slides = slides; + + this.updatePos(); }, updatePos () { this.findChild((child) => { diff --git a/test/routers/carousel.vue b/test/routers/carousel.vue index a73652f0..2cbcb5cd 100644 --- a/test/routers/carousel.vue +++ b/test/routers/carousel.vue @@ -21,6 +21,7 @@ Push + Remove - + 警告提示文案