[Improvement] Tab: click event add title param (#761)

This commit is contained in:
neverland
2018-03-23 11:10:35 +08:00
committed by GitHub
parent 0521c75b9c
commit 8ed6c73528
13 changed files with 45 additions and 50 deletions

View File

@@ -229,10 +229,11 @@ export default create({
// emit event when clicked
onClick(index) {
if (this.tabs[index].disabled) {
this.$emit('disabled', index);
const { title, disabled } = this.tabs[index];
if (disabled) {
this.$emit('disabled', index, title);
} else {
this.$emit('click', index);
this.$emit('click', index, title);
this.curActive = index;
}
},