update the number of rows if the data set changes on mdTable (#320)

* Fix on mdTable numberOfRows and numberOfSelected

* Fix on mdTable numberOfRows and numberOfSelected
This commit is contained in:
Pablo Henrique 2017-01-11 14:14:16 -02:00 committed by Marcos Moura
parent 7de412c0bd
commit 06e404c992

View file

@ -41,6 +41,14 @@
this.$emit('select', this.selectedRows);
}
},
watch: {
data() {
this.numberOfRows = this.data.length;
},
selectedRows() {
this.numberOfSelected = Object.keys(this.selectedRows).length;
}
},
mounted() {
this.parentCard = getClosestVueParent(this.$parent, 'md-table-card');