|
94 | 94 | <span v-if="cellMergeContentType(rowIndex,col.field,item).isComponent"> |
95 | 95 | <component :rowData="item" :field="col.field ? col.field : ''" |
96 | 96 | :index="rowIndex" |
97 | | - :is="cellMerge(rowIndex,item,col.field).componentName" @on-custom-comp="customCompFunc"></component> |
| 97 | + :is="cellMerge(rowIndex,item,col.field).componentName" |
| 98 | + @on-custom-comp="customCompFunc"></component> |
98 | 99 | </span> |
99 | 100 | <span v-else v-html="cellMerge(rowIndex,item,col.field).content"></span> |
100 | 101 | </div> |
|
107 | 108 | > |
108 | 109 | <span v-if="typeof col.componentName ==='string' && col.componentName.length > 0"> |
109 | 110 | <component :rowData="item" :field="col.field ? col.field : ''" |
110 | | - :index="rowIndex" :is="col.componentName" @on-custom-comp="customCompFunc"></component> |
| 111 | + :index="rowIndex" :is="col.componentName" |
| 112 | + @on-custom-comp="customCompFunc"></component> |
111 | 113 | </span> |
112 | 114 | <span v-else-if="typeof col.formatter==='function'" |
113 | 115 | v-html="col.formatter(item,rowIndex,pagingIndex,col.field)"></span> |
|
133 | 135 | :style="{'width': leftViewWidth+'px'}"> |
134 | 136 | <table class="v-table-ftable" cellspacing="0" cellpadding="0" border="0"> |
135 | 137 | <tr class="v-table-row" v-for="(item,rowIndex) in frozenFooterCols"> |
136 | | - <td v-for="(col,colIndex) in item" :class="setFooterCellClassName(true,rowIndex,colIndex,col.content)"> |
| 138 | + <td v-for="(col,colIndex) in item" |
| 139 | + :class="setFooterCellClassName(true,rowIndex,colIndex,col.content)"> |
137 | 140 | <div :style="{'height':footerRowHeight+'px','line-height':footerRowHeight+'px','width':col.width+'px','text-align':col.align}" |
138 | 141 | :class="['v-table-body-cell',vTableBodyCell]" |
139 | 142 | v-html="col.content"></div> |
|
238 | 241 | > |
239 | 242 | <span v-if="cellMergeContentType(rowIndex,col.field,item).isComponent"> |
240 | 243 | <component :rowData="item" :field="col.field ? col.field : ''" :index="rowIndex" |
241 | | - :is="cellMerge(rowIndex,item,col.field).componentName" @on-custom-comp="customCompFunc"></component> |
| 244 | + :is="cellMerge(rowIndex,item,col.field).componentName" |
| 245 | + @on-custom-comp="customCompFunc"></component> |
242 | 246 | </span> |
243 | 247 | <span v-else v-html="cellMerge(rowIndex,item,col.field).content"> |
244 | 248 | </span> |
|
278 | 282 | :style="{'width': rightViewWidth+'px'}"> |
279 | 283 | <table class="v-table-ftable" cellspacing="0" cellpadding="0" border="0"> |
280 | 284 | <tr class="v-table-row" v-for="(item,rowIndex) in noFrozenFooterCols"> |
281 | | - <td v-for="(col,colIndex) in item" :class="setFooterCellClassName(false,rowIndex,colIndex,col.content)"> |
| 285 | + <td v-for="(col,colIndex) in item" |
| 286 | + :class="setFooterCellClassName(false,rowIndex,colIndex,col.content)"> |
282 | 287 | <div :style="{'height':footerRowHeight+'px','line-height':footerRowHeight+'px','width':col.width+'px','text-align':col.align}" |
283 | 288 | :class="['v-table-body-cell',vTableBodyCell]" |
284 | 289 | v-html="col.content"></div> |
|
333 | 338 |
|
334 | 339 | export default { |
335 | 340 | name: 'v-table', |
336 | | - mixins: [classesMixin,tableResizeMixin, frozenColumnsMixin, scrollControlMixin, sortControlMixin, tableEmptyMixin, dragWidthMixin, cellEditMixin, bodyCellMergeMixin, titleCellMergeMixin, checkboxSelectionMixin, tableFooterMixin, scrollBarControlMixin], |
| 341 | + mixins: [classesMixin, tableResizeMixin, frozenColumnsMixin, scrollControlMixin, sortControlMixin, tableEmptyMixin, dragWidthMixin, cellEditMixin, bodyCellMergeMixin, titleCellMergeMixin, checkboxSelectionMixin, tableFooterMixin, scrollBarControlMixin], |
337 | 342 | components: {tableEmpty, loading, VCheckboxGroup, VCheckbox}, |
338 | 343 | data(){ |
339 | 344 | return { |
|
489 | 494 | require: false, |
490 | 495 | default: 40 |
491 | 496 | }, |
492 | | - columnWidthDrag:{ |
| 497 | + columnWidthDrag: { |
493 | 498 | type: Boolean, |
494 | 499 | default: false |
495 | 500 | }, |
|
525 | 530 | // 左侧区域宽度 |
526 | 531 | leftViewWidth(){ |
527 | 532 | var result = 0 |
528 | | - if (this.frozenCols && this.frozenCols.length > 0) { |
| 533 | + if (this.hasFrozenColumn) { |
529 | 534 | result = this.frozenCols.reduce((total, curr) => total + curr.width, 0); |
530 | 535 | } |
531 | 536 | return result |
532 | 537 | }, |
533 | 538 | // 右侧区域宽度 |
534 | 539 | rightViewWidth(){ |
535 | | - return this.internalWidth - this.leftViewWidth - 2; |
| 540 | +
|
| 541 | + let result = this.internalWidth - this.leftViewWidth; |
| 542 | +
|
| 543 | + return this.hasFrozenColumn ? result - 2 : result; |
536 | 544 | }, |
537 | 545 |
|
538 | 546 | // 左侧、右侧区域高度 |
|
546 | 554 |
|
547 | 555 | if (this.getFooterContainerHeight) { |
548 | 556 |
|
549 | | - result -= this.getFooterContainerHeight + 1; |
| 557 | + result -= this.getFooterContainerHeight; |
550 | 558 | } |
551 | 559 |
|
552 | 560 | return result; |
|
610 | 618 | // custom columns component event |
611 | 619 | customCompFunc(params){ |
612 | 620 |
|
613 | | - this.$emit('on-custom-comp',params); |
| 621 | + this.$emit('on-custom-comp', params); |
614 | 622 | }, |
615 | 623 |
|
616 | 624 | setRowHoverColor(isMouseenter){ |
|
755 | 763 | if (self.isHorizontalResize) { |
756 | 764 | console.error(self.errorMsg + "If you are using the isHorizontalResize property,Please set the value for each column's width"); |
757 | 765 | } else { |
758 | | - item.width = self.internalWidth - self.totalColumnsWidth - 2; |
| 766 | + item.width = self.internalWidth - self.totalColumnsWidth; |
759 | 767 | } |
760 | 768 |
|
761 | 769 | } |
|
777 | 785 | if (!(self.internalWidth && self.internalWidth > 0)) { |
778 | 786 |
|
779 | 787 | if (self.columns && self.columns.length > 0) { |
780 | | - self.internalWidth = self.columns.reduce((total, curr) => total + curr.width, 0) + 2; |
| 788 | + self.internalWidth = self.columns.reduce((total, curr) => total + curr.width, 0); |
781 | 789 |
|
782 | 790 | } |
783 | 791 | } |
|
0 commit comments