update Carousel
This commit is contained in:
parent
e129a2508c
commit
1dad8a571e
1 changed files with 5 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
||||||
<script>
|
<script>
|
||||||
import Icon from '../icon/icon.vue';
|
import Icon from '../icon/icon.vue';
|
||||||
import { getStyle, oneOf } from '../../utils/assist';
|
import { getStyle, oneOf } from '../../utils/assist';
|
||||||
|
import { on, off } from '../../utils/dom';
|
||||||
|
|
||||||
const prefixCls = 'ivu-carousel';
|
const prefixCls = 'ivu-carousel';
|
||||||
|
|
||||||
|
@ -240,10 +241,12 @@
|
||||||
this.updateSlides(true);
|
this.updateSlides(true);
|
||||||
this.handleResize();
|
this.handleResize();
|
||||||
this.setAutoplay();
|
this.setAutoplay();
|
||||||
window.addEventListener('resize', this.handleResize, false);
|
// window.addEventListener('resize', this.handleResize, false);
|
||||||
|
on(window, 'resize', this.handleResize);
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
window.removeEventListener('resize', this.handleResize, false);
|
// window.removeEventListener('resize', this.handleResize, false);
|
||||||
|
off(window, 'resize', this.handleResize);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue