[bugfix] Tabbar: change event (#1571)

This commit is contained in:
neverland 2018-08-01 17:37:30 +08:00 committed by GitHub
parent 10ed66cbe5
commit 806df7802f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -140,7 +140,7 @@ Field 默认支持 Input 标签所有的原生事件,如 `focus`、`blur`、`k
| 事件 | 说明 | 回调参数 | | 事件 | 说明 | 回调参数 |
|-----------|-----------|-----------| |-----------|-----------|-----------|
| click-icon | 点击尾部图标时触发 | - | click-icon | 点击尾部图标时触发 | - |
### 方法 ### 方法

View File

@ -44,6 +44,7 @@ export default create({
items() { items() {
this.setActiveItem(); this.setActiveItem();
}, },
value() { value() {
this.setActiveItem(); this.setActiveItem();
} }
@ -55,9 +56,12 @@ export default create({
item.active = index === this.value; item.active = index === this.value;
}); });
}, },
onChange(active) { onChange(active) {
this.$emit('input', active); if (active !== this.value) {
this.$emit('change', active); this.$emit('input', active);
this.$emit('change', active);
}
} }
} }
}); });