Commit 1dad8a571eb05e632dc6e2938f180658ef9cd381

Authored by 梁灏
1 parent e129a250

update Carousel

Showing 1 changed file with 5 additions and 2 deletions   Show diff stats
src/components/carousel/carousel.vue
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
25 <script> 25 <script>
26 import Icon from '../icon/icon.vue'; 26 import Icon from '../icon/icon.vue';
27 import { getStyle, oneOf } from '../../utils/assist'; 27 import { getStyle, oneOf } from '../../utils/assist';
  28 + import { on, off } from '../../utils/dom';
28 29
29 const prefixCls = 'ivu-carousel'; 30 const prefixCls = 'ivu-carousel';
30 31
@@ -240,10 +241,12 @@ @@ -240,10 +241,12 @@
240 this.updateSlides(true); 241 this.updateSlides(true);
241 this.handleResize(); 242 this.handleResize();
242 this.setAutoplay(); 243 this.setAutoplay();
243 - window.addEventListener('resize', this.handleResize, false); 244 +// window.addEventListener('resize', this.handleResize, false);
  245 + on(window, 'resize', this.handleResize);
244 }, 246 },
245 beforeDestroy () { 247 beforeDestroy () {
246 - window.removeEventListener('resize', this.handleResize, false); 248 +// window.removeEventListener('resize', this.handleResize, false);
  249 + off(window, 'resize', this.handleResize);
247 } 250 }
248 }; 251 };
249 </script> 252 </script>