Skip to content

Commit

Permalink
[bugfix] Tabbar: change event (#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Aug 1, 2018
1 parent 10ed66c commit 806df78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/field/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Field 默认支持 Input 标签所有的原生事件,如 `focus`、`blur`、`k

| 事件 | 说明 | 回调参数 |
|-----------|-----------|-----------|
| click-icon | 点击尾部图标时触发 | -
| click-icon | 点击尾部图标时触发 | - |

### 方法

Expand Down
8 changes: 6 additions & 2 deletions packages/tabbar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default create({
items() {
this.setActiveItem();
},
value() {
this.setActiveItem();
}
Expand All @@ -55,9 +56,12 @@ export default create({
item.active = index === this.value;
});
},
onChange(active) {
this.$emit('input', active);
this.$emit('change', active);
if (active !== this.value) {
this.$emit('input', active);
this.$emit('change', active);
}
}
}
});
Expand Down

0 comments on commit 806df78

Please sign in to comment.