Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] Tabbar: change event #1571

Merged
merged 13 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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