Skip to content

Commit

Permalink
inline-calendar: fix on-change event fires twice (Close #1847)
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Aug 16, 2017
1 parent 16334d0 commit 27bbb10
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/components/inline-calendar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ export default {
this.render(this.year, this.month, value)
}
this.$emit('input', this.currentValue)
this.$emit('on-change', this.currentValue)
},
showChild (year, month, child) {
if (this.replaceText(child.day, this.formatDate(year, month, child))) {
Expand Down
5 changes: 5 additions & 0 deletions src/components/inline-calendar/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ events:
en: emits when value is changed
zh-CN: 值变化时触发
changes:
next:
en:
- '[fix] fix on-change event fires twice #1847'
zh-CN:
- '[fix] 修复 on-change 事件触发两次问题 #1847'
v2.5.5:
en:
- '[feature] support multi select #1446 #1467'
Expand Down
6 changes: 6 additions & 0 deletions src/demos/InlineCalendar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div>
<inline-calendar
@on-change="onChange"
class="inline-calendar-demo"
:show.sync="show"
v-model="value"
Expand Down Expand Up @@ -81,6 +82,11 @@
import { InlineCalendar, Group, XSwitch, Radio, XButton, Cell, Divider } from 'vux'
export default {
methods: {
onChange (val) {
console.log('on-change', val)
}
},
data () {
return {
show: true,
Expand Down

0 comments on commit 27bbb10

Please sign in to comment.