Skip to content

Commit

Permalink
picker: emit on-change after nextTick (Close #1589)
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Jul 4, 2017
1 parent 065bc6e commit c3e0ce8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/picker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ export default {
onSelect (value) {
_this.$set(_this.currentValue, i, value)
if (!this.columns || (this.columns && _this.getValue().length === _this.store.count)) {
_this.$emit('on-change', _this.getValue())
_this.$nextTick(() => {
_this.$emit('on-change', _this.getValue())
})
}
if (_this.columns !== 0) {
_this.renderChain(i + 1)
Expand Down Expand Up @@ -119,7 +121,9 @@ export default {
itemClass: _this.item_class,
onSelect (value) {
_this.$set(_this.currentValue, i, value)
_this.$emit('on-change', _this.getValue())
_this.$nextTick(() => {
_this.$emit('on-change', _this.getValue())
})
_this.renderChain(i + 1)
}
})
Expand Down

0 comments on commit c3e0ce8

Please sign in to comment.