removed observer
This commit is contained in:
parent
8f4e2cf0c3
commit
373dfb3cad
2 changed files with 11 additions and 19 deletions
|
@ -23,9 +23,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compiled () {
|
compiled () {
|
||||||
// this.$parent.slotChange();
|
this.$parent.slotChange();
|
||||||
// this.$parent.updateSlides(true, true);
|
},
|
||||||
// this.$parent.updatePos();
|
beforeDestroy () {
|
||||||
|
this.$parent.slotChange();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -137,8 +137,13 @@
|
||||||
},
|
},
|
||||||
// use when slot changed
|
// use when slot changed
|
||||||
slotChange () {
|
slotChange () {
|
||||||
this.slides = [];
|
this.$nextTick(() => {
|
||||||
this.slideInstances = [];
|
this.slides = [];
|
||||||
|
this.slideInstances = [];
|
||||||
|
|
||||||
|
this.updateSlides(true, true);
|
||||||
|
this.updatePos();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleResize () {
|
handleResize () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -167,20 +172,6 @@
|
||||||
},
|
},
|
||||||
compiled () {
|
compiled () {
|
||||||
this.updateSlides(true);
|
this.updateSlides(true);
|
||||||
|
|
||||||
// watch slot changed
|
|
||||||
if (MutationObserver) {
|
|
||||||
this.observer = new MutationObserver(() => {
|
|
||||||
this.slotChange();
|
|
||||||
this.updateSlides(true, true);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.observer.observe(this.$els.slides, {
|
|
||||||
childList: true,
|
|
||||||
characterData: true,
|
|
||||||
subtree: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
autoplay () {
|
autoplay () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue