2025-08-07 11:48:58 +08:00
|
|
|
<template>
|
2025-08-09 10:40:47 +08:00
|
|
|
<view class="histyRecords">
|
|
|
|
<scroll-view class="tab-bar" scroll-x="true" scroll-with-animation>
|
|
|
|
<view class="tab-container">
|
|
|
|
<view v-for="(tab, index) in tabs" :key="index"
|
|
|
|
:class="['tab-item', activeTab === index ? 'active' : '']" @click="switchTab(tab,index)">
|
|
|
|
{{tab.name}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
2025-08-07 11:48:58 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2025-08-09 10:40:47 +08:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tabs: [{
|
|
|
|
name: '开机',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: '报警',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
activeTab: 0,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// tab切换页
|
|
|
|
switchTab(tab, index) {
|
|
|
|
this.activeTab = index
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2025-08-07 11:48:58 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
2025-08-09 10:40:47 +08:00
|
|
|
.histyRecords {
|
|
|
|
width: 100%;
|
|
|
|
height: 100vh;
|
|
|
|
background: rgba(18, 18, 18, 1);
|
|
|
|
padding: 30rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tab-bar {
|
|
|
|
width: 100%;
|
|
|
|
color: rgb(255, 255, 255);
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.tab-container {
|
|
|
|
display: flex;
|
|
|
|
cursor: pointer;
|
|
|
|
margin-bottom: 40rpx;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.tab-item {
|
|
|
|
font-size: 28rpx;
|
|
|
|
padding: 0 30rpx;
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.active {
|
|
|
|
color: rgba(187, 230, 0, 1);
|
|
|
|
border-bottom: 6rpx solid rgba(187, 230, 0, 1);
|
|
|
|
height: 60rpx;
|
|
|
|
}
|
2025-08-07 11:48:58 +08:00
|
|
|
</style>
|