epmet pc工作端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.1 KiB

<template>
<div class="tabs">
<div class="tab" :class="value2 === item.value?'cur':''" v-for="(item,index) in list" @click="tabClick(index)" :key="index">
{{item.label}}
</div>
</div>
</template>
<script>
export default {
name: "Tabs",
props: {
list:{
type: Array,
default: () => []
},
value:{
type: [String,Number],
default: ''
}
},
data() {
return {
value2: this.value,
}
},
mounted() {
this.value2 = this.value
},
methods: {
tabClick(index) {
this.value2 = this.list[index].value
this.$emit('changeVal',this.value)
this.$emit('changeLabel',this.list[index].label)
}
}
}
</script>
<style scoped lang="scss">
.tabs {
display: flex;
.tab {
cursor: pointer;
padding: 10px 11px;
font-size: 14px;
font-weight: 400;
color: #FFFFFF;
background: url("@/assets/images/manyidu/tab.png") repeat-x top left;
margin-right: 4px;
&.cur {
background: url("@/assets/images/manyidu/tab_cur.png") repeat-x top left;
}
}
}
</style>