更新代码
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user