Skip to content

Commit

Permalink
comp(MdTable): also handle case #2 AOT
Browse files Browse the repository at this point in the history
providing selection data Ahead of Time, aka, ahead of table data, will also break MdTable. This handles both cases.
  • Loading branch information
Ray Foss authored Jul 24, 2018
1 parent 768a2db commit 42ce8fc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/MdTable/MdTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@
this.select(val)
}
},
mdSelectedValue: async function () {
await this.$nextTick() // render the table first
mdSelectedValue () {
this.syncSelectedValue()
},
value () {
this.syncSelectedValue()
}
},
Expand Down Expand Up @@ -333,7 +335,8 @@
this.$emit('update:mdSelectedValue', val)
this.$emit('md-selected', val)
},
syncSelectedValue () {
syncSelectedValue: async function () {
await this.$nextTick() // render the table first
if (this.MdTable.selectingMode === 'single') {
this.MdTable.singleSelection = this.mdSelectedValue
} else if (this.MdTable.selectingMode === 'multiple') {
Expand Down

0 comments on commit 42ce8fc

Please sign in to comment.