File tree Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 15
15
aria-valuemax =" 100"
16
16
>
17
17
<div class =" el-progress-bar" v-if =" type === 'line'" >
18
- <div class =" el-progress-bar__outer" :style =" {height: strokeWidth + 'px'}" >
18
+ <div class =" el-progress-bar__outer" :style =" {height: strokeWidth + 'px', backgroundColor:defineBackColor }" >
19
19
<div class =" el-progress-bar__inner" :style =" barStyle" >
20
- <div class =" el-progress-bar__innerText" v-if =" showText && textInside" >{{content}}</div >
20
+ <div class =" el-progress-bar__innerText" :style = " {color:textColor} " v-if =" showText && textInside" >{{content}}</div >
21
21
</div >
22
22
</div >
23
23
</div >
26
26
<path
27
27
class =" el-progress-circle__track"
28
28
:d =" trackPath"
29
- stroke =" #e5e9f2 "
29
+ : stroke =" defineBackColor "
30
30
:stroke-width =" relativeStrokeWidth"
31
31
fill =" none"
32
32
:style =" trailPathStyle" ></path >
43
43
<div
44
44
class =" el-progress__text"
45
45
v-if =" showText && !textInside"
46
- :style =" {fontSize: progressTextSize + 'px'}"
46
+ :style =" {fontSize: progressTextSize + 'px', color:textColor }"
47
47
>
48
48
<template v-if =" ! status " >{{content}}</template >
49
49
<i v-else :class =" iconClass" ></i >
93
93
type: [String , Array , Function ],
94
94
default: ' '
95
95
},
96
+ defineBackColor: {
97
+ type: [String , Array , Function ],
98
+ default: ' #ebeef5'
99
+ },
100
+ textColor: {
101
+ type: [String , Array , Function ],
102
+ default: ' #606266'
103
+ },
96
104
format: Function
97
105
},
98
106
computed: {
Original file line number Diff line number Diff line change 37
37
disabled: {
38
38
type: Boolean ,
39
39
default: false
40
+ },
41
+ selectedColor: {
42
+ type: String ,
43
+ default: ' #409EFF'
40
44
}
41
45
},
42
46
131
135
selectOptionClick () {
132
136
if (this .disabled !== true && this .groupDisabled !== true ) {
133
137
this .dispatch (' ElSelect' , ' handleOptionClick' , [this , true ]);
138
+ if (this .selectedColor !== ' #409EFF' ) {
139
+ // 如果不是默认的颜色
140
+ if (this .$el .className === ' el-select-dropdown__item selected hover' ||
141
+ this .$el .className === ' el-select-dropdown__item hover'
142
+ ) {
143
+ let siblingsNode = this .$parent .$children ;
144
+ siblingsNode .forEach (item => {
145
+ if (item .$el .className === ' el-select-dropdown__item' ||
146
+ item .$el .className === ' el-select-dropdown__item selected' ) {
147
+ item .$el .style .color = ' #606266' ;
148
+ }
149
+ });
150
+ this .$el .style .color = this .selectedColor ;
151
+ } else {
152
+ this .$el .style .color = ' #606266' ;
153
+ }
154
+
155
+ }
134
156
}
135
157
},
136
158
150
172
151
173
this .$on (' queryChange' , this .queryChange );
152
174
this .$on (' handleGroupDisabled' , this .handleGroupDisabled );
175
+
153
176
},
154
177
155
178
beforeDestroy () {
You can’t perform that action at this time.
0 commit comments