This commit is contained in:
zhuxiang
2017-03-07 16:40:06 +08:00
parent fdf2868cc7
commit 14110f6c90
4 changed files with 113 additions and 55 deletions
+6 -10
View File
@@ -8,30 +8,26 @@
export default {
name: 'zan-tab',
props: {
// 对应 Tabs 组件的 activeKey
tabKey: {
type: [Number, String],
required: true
},
// 选项卡头显示文字
title: {
type: String,
required: true
},
tabPaneClassName: {
paneclass: {
type: String
}
},
disable: Boolean
},
computed: {
classNames() {
return [
{'is-select': this.tabKey == this.$parent.switchActiveTabKey},
this.tabPaneClassName
{'is-select': this.$parent.tabs.indexOf(this) == this.$parent.switchActiveTabKey },
this.paneclass
];
}
},
created () {
this.$parent.tabCreate(this.tabKey, this.title);
this.$parent.tabs.push(this);
}
};
</script>