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 () {
|
||||
// this.$parent.slotChange();
|
||||
// this.$parent.updateSlides(true, true);
|
||||
// this.$parent.updatePos();
|
||||
this.$parent.slotChange();
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.$parent.slotChange();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -137,8 +137,13 @@
|
|||
},
|
||||
// use when slot changed
|
||||
slotChange () {
|
||||
this.slides = [];
|
||||
this.slideInstances = [];
|
||||
this.$nextTick(() => {
|
||||
this.slides = [];
|
||||
this.slideInstances = [];
|
||||
|
||||
this.updateSlides(true, true);
|
||||
this.updatePos();
|
||||
});
|
||||
},
|
||||
handleResize () {
|
||||
this.$nextTick(() => {
|
||||
|
@ -167,20 +172,6 @@
|
|||
},
|
||||
compiled () {
|
||||
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: {
|
||||
autoplay () {
|
||||
|
|
Loading…
Add table
Reference in a new issue