1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<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>