更新代码

This commit is contained in:
ahanhanhan
2024-02-22 15:53:22 +08:00
parent 49631f0554
commit 459de38465
5 changed files with 126 additions and 76 deletions

View File

@@ -5,7 +5,7 @@
<div class="operation">
<div :class="['btn', index === activeIndex ? 'active' : '']"
v-for="({ prop, label }, index) in operation"
:key="prop"
:key="prop || index"
@click="handleSwitch(label, prop, index)">{{ label }}</div>
</div>
</div>
@@ -43,11 +43,16 @@ export default {
type: String,
default: ''
},
data: {
type: Array,
default: ()=> []
},
operation: {
type: Array,
default: ()=> ([{ label: '总', prop: '' }, { label: '日', prop: '' }])
}
},
data() {
return {
activeIndex: 0
@@ -105,6 +110,8 @@ export default {
}
.list-content {
width: 100%;
overflow: hidden;
.list-item {
height: 37px;
line-height: 37px;