mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
40 lines
839 B
Vue
40 lines
839 B
Vue
<template>
|
|
<van-tabs :active="active" :duration="duration" @click="handleTabClick" @disabled="handleTabDisabledClick" :sticky="sticky">
|
|
<van-tab :title="firstTabTitle" :disabled="firstTabDisabled">内容一</van-tab>
|
|
<van-tab title="选项二">内容二</van-tab>
|
|
<van-tab title="选项三" disabled>内容三</van-tab>
|
|
<van-tab title="选项四">内容四</van-tab>
|
|
</van-tabs>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
firstTabTitle: {
|
|
type: String,
|
|
default: '选项一'
|
|
},
|
|
firstTabDisabled: {
|
|
type: Boolean
|
|
},
|
|
sticky: Boolean
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
active: 0,
|
|
duration: 0.5
|
|
};
|
|
},
|
|
|
|
methods: {
|
|
handleTabClick(index) {
|
|
this.$emit('click');
|
|
},
|
|
handleTabDisabledClick(index) {
|
|
this.$emit('disabled');
|
|
}
|
|
}
|
|
};
|
|
</script>
|