wangrong
2026-08-30 761e5c5fa871959f60e15c971c8d83f2b53d0af5
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
67
68
69
70
71
72
73
74
75
76
77
<script setup lang="ts">
import { toRefs } from 'vue'
import { propTypes } from '@/utils/propTypes'
import Icon from '../icon-custom/src/Icon.vue'
import { ElCol } from 'element-plus-secondary'
 
const props = defineProps({
  title: propTypes.string,
  tips: propTypes.string,
  iconName: propTypes.object,
  showSplitLine: propTypes.bool,
  active: propTypes.bool
})
 
const { title, tips, iconName, showSplitLine } = toRefs(props)
const emits = defineEmits(['customClick'])
</script>
 
<template>
  <div class="flex-align-center">
    <el-row class="group_icon" :title="tips" @click="emits('customClick')">
      <el-col :span="24" class="group_inner" :class="{ 'inner-active': active }">
        <Icon><component class="svg-icon toolbar-icon" :is="iconName"></component></Icon>
        <span>{{ title }}</span>
      </el-col>
    </el-row>
    <el-divider class="group-right-border" v-if="showSplitLine" direction="vertical" />
  </div>
</template>
<style lang="less" scoped>
.flex-align-center {
  & + & {
    margin-left: 4px;
  }
}
.group_inner {
  padding: 8px;
  display: flex;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  border-radius: 4px;
  color: #a6a6a6;
 
  span {
    float: left;
    font-size: 12px;
    margin-top: 8px;
    line-height: 12px;
  }
  &:hover {
    background: rgba(235, 235, 235, 0.1);
    color: #fff;
  }
  &:active {
    color: #fff;
    background: rgba(235, 235, 235, 0.2);
  }
}
 
.group-right-border {
  border-color: rgba(255, 255, 255, 0.15);
  margin: 0 2px 0 6px;
  height: 40px;
}
 
.inner-active {
  border: 1px solid var(--ed-color-primary);
  background: rgba(255, 255, 255, 0.2);
}
 
.toolbar-icon {
  float: left;
  width: 20px;
  height: 20px;
}
</style>