Skip to content
Permalink
Browse files

fix(MdTable): remove table head when column removed (#1354)

fix #1347
  • Loading branch information...
VdustR authored and marcosmoura committed Dec 29, 2017
1 parent 8115f32 commit b54eb1054bd1d024fe0fa3ae31743b53f7710e6f
Showing with 15 additions and 2 deletions.
  1. +15 −2 src/components/MdTable/MdTableCell.vue
@@ -17,7 +17,8 @@
},
inject: ['MdTable'],
data: () => ({
index: null
index: null,
parentNode: null
}),
computed: {
cellClasses () {
@@ -50,7 +51,9 @@
})
},
updateAllCellData () {
const cells = Array.from(this.$el.parentNode.childNodes).filter(({ tagName, classList }) => {
this.MdTable.items = {}
const cells = Array.from(this.parentNode.childNodes).filter(({ tagName, classList }) => {
const isSelection = classList && classList.contains('md-table-cell-selection')
const isTd = tagName && tagName.toLowerCase() === 'td'
@@ -67,6 +70,16 @@
}
},
mounted () {
this.parentNode = this.$el.parentNode
this.updateAllCellData()
},
destroyed () {
const rowRemoved = this.$el.parentNode !== null
if (rowRemoved) {
return false
}
this.updateAllCellData()
}
}

0 comments on commit b54eb10

Please sign in to comment.
You can’t perform that action at this time.