Files
vant/packages/tab/src/tab.vue
T
2017-03-07 16:40:06 +08:00

34 lines
618 B
Vue

<template>
<div class="zan-tabs-pane" :class="classNames">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'zan-tab',
props: {
// 选项卡头显示文字
title: {
type: String,
required: true
},
paneclass: {
type: String
},
disable: Boolean
},
computed: {
classNames() {
return [
{'is-select': this.$parent.tabs.indexOf(this) == this.$parent.switchActiveTabKey },
this.paneclass
];
}
},
created () {
this.$parent.tabs.push(this);
}
};
</script>