mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 09:24:25 +00:00
directory adjust: delete entry index.js
This commit is contained in:
36
packages/tab/index.vue
Normal file
36
packages/tab/index.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="van-tab__pane" :class="classNames">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'van-tab',
|
||||
props: {
|
||||
// 选项卡头显示文字
|
||||
title: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
disabled: Boolean
|
||||
},
|
||||
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.key === this.$parent.curActive };
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Reference in New Issue
Block a user