Commit f00b5343906c832eedf4565442fad0bd1ba06e78

Authored by 梁灏
1 parent ce45917b

update Table

Showing 1 changed file with 5 additions and 2 deletions   Show diff stats
src/components/table/table.vue
... ... @@ -88,6 +88,7 @@
88 88 import tableHead from './table-head.vue';
89 89 import tableBody from './table-body.vue';
90 90 import { oneOf, getStyle, deepCopy, getScrollBarSize } from '../../utils/assist';
  91 + import { on, off } from '../../utils/dom';
91 92 import Csv from '../../utils/csv';
92 93 import ExportCsv from './export-csv';
93 94 import Locale from '../../mixins/locale';
... ... @@ -691,7 +692,8 @@
691 692 this.handleResize();
692 693 this.fixedHeader();
693 694 this.$nextTick(() => this.ready = true);
694   - window.addEventListener('resize', this.handleResize, false);
  695 +// window.addEventListener('resize', this.handleResize, false);
  696 + on(window, 'resize', this.handleResize);
695 697 this.$on('on-visible-change', (val) => {
696 698 if (val) {
697 699 this.handleResize();
... ... @@ -700,7 +702,8 @@
700 702 });
701 703 },
702 704 beforeDestroy () {
703   - window.removeEventListener('resize', this.handleResize, false);
  705 +// window.removeEventListener('resize', this.handleResize, false);
  706 + off(window, 'resize', this.handleResize);
704 707 },
705 708 watch: {
706 709 data: {
... ...