<template>
|
<!--
|
作者:lyzflash
|
时间:2023-08-10
|
描述:diy组件-模拟显示-选项卡组
|
-->
|
<div @click.stop="$parent.$parent.onEditer(index)">
|
<div class="drag optional" :class="{selected:index === selectedIndex}">
|
<div class="diy-tab-box" :style="{background:item.style.background}">
|
<ul class="list tab-list" :class="item.style.show_type==2?'tab-nowrap':'tab-flex d-b-c'">
|
<li class="item" :key="index" v-for="(navBar,index) in item.data" :style="index==0?'background:'+item.style.background_active:''">
|
<div class="item-text" :class="item.style.show_type==1?'text-ellipsis':''" :style="index==0?'color:'+item.style.text_active:'color:'+navBar.color">{{navBar.text}}</div>
|
</li>
|
</ul>
|
</div>
|
<div class="btn-edit-del">
|
<div class="btn-del" @click.stop="$parent.$parent.onDeleleItem(index)">删除</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
|
};
|
},
|
props: ['item', 'index', 'selectedIndex'],
|
methods: {
|
|
}
|
};
|
</script>
|
|
<style>
|
.diy-tab-box .list{ display: flex; flex-wrap: wrap; align-items: flex-start;}
|
.diy-tab-box .list .item{ padding: 10px 20px; display: flex; justify-content: center; align-items: center; flex-direction: column;}
|
.diy-tab-box .list .item-text{ width: 100%; padding: 4px 0; text-align: center;}
|
.diy-tab-box .tab-list li {
|
position: relative;
|
}
|
.diy-tab-box .tab-list li:before {
|
content: '';
|
position: absolute;
|
left: 0;
|
top: 5px;
|
bottom: 5px;
|
border-left: 1px solid #eee;
|
}
|
.diy-tab-box .button-list li:first-child:before {
|
border: 0;
|
}
|
.tab-flex .item {
|
flex: 1;
|
}
|
.diy-tab-box .tab-nowrap {
|
display: block;
|
white-space: nowrap;
|
overflow: hidden;
|
}
|
.diy-tab-box .tab-nowrap .item {
|
display: inline-block;
|
}
|
</style>
|