55</template >
66
77<script setup lang="ts">
8- import { computed } from ' vue'
8+ import {computed } from ' vue'
9+
910const props = defineProps ({
1011 hideTitle: Boolean ,
11- /* 颜色可以单词,如red;也可以是颜色值 */
12- // 字体颜色
12+ /* Color can be a word, such as red; It can also be a color value */
13+ // Font color
1314 fontColor: String ,
14- // 激活字体颜色
15+ // Activate font color
1516 activeColor: String ,
16- // 边框颜色 如果是none就无边框 如果是none Card类型激活的下滑线也消失
17+ // If the border color is none, there will be no border.
18+ // If it is none, the activated slide line of the Card type will also disappear
1719 borderColor: String ,
18- // 激活边框颜色 目前只针对card类型
20+ // Activate border color currently only for card types
1921 borderActiveColor: String ,
20- // 样式类型 radioGroup只在Card类型有效, 同时必须给borderColor borderActiveColor
22+ // The style type radioGroup is only valid for Card type,
23+ // and it must be given as borderColor borderActiveColor
2124 styleType: {
2225 type: String ,
2326 default: ' ' ,
@@ -26,21 +29,21 @@ const props = defineProps({
2629})
2730
2831const tabStyle = computed (() => [
29- { ' --de-font-color' : props .fontColor },
30- { ' --de-active-color' : props .activeColor },
31- { ' --de-border-color' : props .borderColor },
32- { ' --de-border-active-color' : props .borderActiveColor }
32+ {' --de-font-color' : props .fontColor },
33+ {' --de-active-color' : props .activeColor },
34+ {' --de-border-color' : props .borderColor },
35+ {' --de-border-active-color' : props .borderActiveColor }
3336])
3437const tabClassName = computed (() =>
35- props .styleType
36- ? [props .styleType , props .fontColor && ' fontColor' , props .activeColor && ' activeColor' ]
37- : [
38- props .fontColor && ' fontColor' ,
39- props .activeColor && ' activeColor' ,
40- noBorder .value ? ' noBorder' : props .borderColor && ' borderColor' ,
41- props .borderActiveColor && ' borderActiveColor' ,
42- props .hideTitle && ' no-header'
43- ]
38+ props .styleType
39+ ? [props .styleType , props .fontColor && ' fontColor' , props .activeColor && ' activeColor' ]
40+ : [
41+ props .fontColor && ' fontColor' ,
42+ props .activeColor && ' activeColor' ,
43+ noBorder .value ? ' noBorder' : props .borderColor && ' borderColor' ,
44+ props .borderActiveColor && ' borderActiveColor' ,
45+ props .hideTitle && ' no-header'
46+ ]
4447)
4548
4649const noBorder = computed (() => props .borderColor === ' none' )
@@ -49,16 +52,19 @@ const noBorder = computed(() => props.borderColor === 'none')
4952<style lang="less">
5053.de-tabs {
5154 height : 100% ;
55+
5256 & .no-header {
5357 .ed-tabs__header {
5458 display : none ;
5559 }
5660 }
61+
5762 & .ed-tabs--card {
5863 > .ed-tabs__header {
5964 height : auto !important ;
6065 }
6166 }
67+
6268 & .fontColor {
6369 .ed-tabs__item {
6470 color : var (--de-font-color );
@@ -90,7 +96,7 @@ const noBorder = computed(() => props.borderColor === 'none')
9096 }
9197 }
9298
93- // card样式的边框
99+ // Card style border
94100 & .noBorder.ed-tabs--card {
95101 > .ed-tabs__header {
96102 border-bottom : none ;
@@ -144,7 +150,7 @@ const noBorder = computed(() => props.borderColor === 'none')
144150 }
145151 }
146152
147- // 简洁样式的边框
153+ // A simple style border
148154 & .noBorder {
149155 .ed-tabs__nav-wrap ::after {
150156 background : none ;
@@ -157,7 +163,7 @@ const noBorder = computed(() => props.borderColor === 'none')
157163 }
158164 }
159165
160- // radioGroup 类型
166+ // radioGroup type
161167 & .radioGroup.ed-tabs--card {
162168 > .ed-tabs__header {
163169 border-bottom : none ;
0 commit comments