mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
@@ -15,12 +15,21 @@
|
||||
},
|
||||
disabled: Boolean
|
||||
},
|
||||
beforeCreate() {
|
||||
this.$parent.tabs.push(this);
|
||||
data() {
|
||||
const nextIndex = this.$parent.tabs.length;
|
||||
this.$parent.tabs.push({
|
||||
title: this.title,
|
||||
disabled: this.disabled,
|
||||
index: nextIndex
|
||||
});
|
||||
|
||||
return {
|
||||
key: nextIndex
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
classNames() {
|
||||
return { 'van-tab__pane--select': this.$parent.tabs.indexOf(this) === this.$parent.curActive };
|
||||
return { 'van-tab__pane--select': this.key === this.$parent.curActive };
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user