62 lines
1.1 KiB
Vue
62 lines
1.1 KiB
Vue
<script setup>
|
||
defineProps({
|
||
tabs: {
|
||
type: Array,
|
||
default: () => [],
|
||
},
|
||
active: {
|
||
type: String,
|
||
default: "vip",
|
||
},
|
||
});
|
||
|
||
const emit = defineEmits(["select"]);
|
||
</script>
|
||
|
||
<template>
|
||
<!-- 业务 Tab 只切换内容,不接管系统导航。 -->
|
||
<view class="section-tabs">
|
||
<view
|
||
v-for="tab in tabs"
|
||
:key="tab.key"
|
||
class="section-tabs__item"
|
||
:class="{ 'section-tabs__item--active': active === tab.key }"
|
||
hover-class="section-tabs__item--pressed"
|
||
@click="emit('select', tab.key)"
|
||
>
|
||
<text>{{ tab.label }}</text>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<style scoped lang="scss">
|
||
.section-tabs {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
padding: 20rpx 40rpx 0;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.section-tabs__item {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
width: 326rpx;
|
||
height: 68rpx;
|
||
border-radius: 34rpx;
|
||
color: #999999;
|
||
background: #000000;
|
||
font-size: 28rpx;
|
||
line-height: 40rpx;
|
||
}
|
||
|
||
.section-tabs__item--active {
|
||
color: #ffffff;
|
||
background: linear-gradient(135deg, #ffd19a, #a17636);
|
||
}
|
||
|
||
.section-tabs__item--pressed {
|
||
opacity: 0.8;
|
||
}
|
||
</style>
|