Commit a6bb1d9023819beb373422ea647fa3caf86bd8ec
Committed by
GitHub
Merge pull request #1955 from chjtx/2.0
修复table里嵌套table报 Cannot read property 'width' of undefined"的错误
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/components/table/table.vue
@@ -351,7 +351,7 @@ | @@ -351,7 +351,7 @@ | ||
351 | if (allWidth) autoWidthIndex = this.cloneColumns.findIndex(cell => !cell.width);//todo 这行可能有问题 | 351 | if (allWidth) autoWidthIndex = this.cloneColumns.findIndex(cell => !cell.width);//todo 这行可能有问题 |
352 | 352 | ||
353 | if (this.data.length) { | 353 | if (this.data.length) { |
354 | - const $td = this.$refs.tbody.$el.querySelectorAll('tbody tr')[0].querySelectorAll('td'); | 354 | + const $td = this.$refs.tbody.$el.querySelectorAll('tbody tr')[0].children; |
355 | for (let i = 0; i < $td.length; i++) { // can not use forEach in Firefox | 355 | for (let i = 0; i < $td.length; i++) { // can not use forEach in Firefox |
356 | const column = this.cloneColumns[i]; | 356 | const column = this.cloneColumns[i]; |
357 | 357 |