tabs almost

This commit is contained in:
zhuxiang
2017-03-03 14:08:33 +08:00
parent b9716a4dab
commit 522830aac5
13 changed files with 392 additions and 2 deletions
+37
View File
@@ -0,0 +1,37 @@
<template>
<div class="zan-tabs-pane" :class="classNames">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'zan-tab',
props: {
// 对应 Tabs 组件的 activeKey
tabKey: {
type: [Number, String],
required: true
},
// 选项卡头显示文字
title: {
type: String,
required: true
},
tabPaneClassName: {
type: String
}
},
computed: {
classNames() {
return [
{'is-select': this.tabKey == this.$parent.switchActiveTabKey},
this.tabPaneClassName
];
}
},
created () {
this.$parent.tabCreate(this.tabKey, this.title);
}
};
</script>