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,6 +88,7 @@
88 import tableHead from './table-head.vue'; 88 import tableHead from './table-head.vue';
89 import tableBody from './table-body.vue'; 89 import tableBody from './table-body.vue';
90 import { oneOf, getStyle, deepCopy, getScrollBarSize } from '../../utils/assist'; 90 import { oneOf, getStyle, deepCopy, getScrollBarSize } from '../../utils/assist';
  91 + import { on, off } from '../../utils/dom';
91 import Csv from '../../utils/csv'; 92 import Csv from '../../utils/csv';
92 import ExportCsv from './export-csv'; 93 import ExportCsv from './export-csv';
93 import Locale from '../../mixins/locale'; 94 import Locale from '../../mixins/locale';
@@ -691,7 +692,8 @@ @@ -691,7 +692,8 @@
691 this.handleResize(); 692 this.handleResize();
692 this.fixedHeader(); 693 this.fixedHeader();
693 this.$nextTick(() => this.ready = true); 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 this.$on('on-visible-change', (val) => { 697 this.$on('on-visible-change', (val) => {
696 if (val) { 698 if (val) {
697 this.handleResize(); 699 this.handleResize();
@@ -700,7 +702,8 @@ @@ -700,7 +702,8 @@
700 }); 702 });
701 }, 703 },
702 beforeDestroy () { 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 watch: { 708 watch: {
706 data: { 709 data: {