Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issues #22065, el-progress添加底色,文字颜色的属性 #22089

Merged
merged 2 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions packages/progress/src/progress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
aria-valuemax="100"
>
<div class="el-progress-bar" v-if="type === 'line'">
<div class="el-progress-bar__outer" :style="{height: strokeWidth + 'px'}">
<div class="el-progress-bar__outer" :style="{height: strokeWidth + 'px', backgroundColor:defineBackColor}">
<div class="el-progress-bar__inner" :style="barStyle">
<div class="el-progress-bar__innerText" v-if="showText && textInside">{{content}}</div>
<div class="el-progress-bar__innerText" :style="{color:textColor}" v-if="showText && textInside">{{content}}</div>
</div>
</div>
</div>
Expand All @@ -26,7 +26,7 @@
<path
class="el-progress-circle__track"
:d="trackPath"
stroke="#e5e9f2"
:stroke="defineBackColor"
:stroke-width="relativeStrokeWidth"
fill="none"
:style="trailPathStyle"></path>
Expand All @@ -43,7 +43,7 @@
<div
class="el-progress__text"
v-if="showText && !textInside"
:style="{fontSize: progressTextSize + 'px'}"
:style="{fontSize: progressTextSize + 'px', color:textColor}"
>
<template v-if="!status">{{content}}</template>
<i v-else :class="iconClass"></i>
Expand Down Expand Up @@ -93,6 +93,14 @@
type: [String, Array, Function],
default: ''
},
defineBackColor: {
type: [String, Array, Function],
default: '#ebeef5'
},
textColor: {
type: [String, Array, Function],
default: '#606266'
},
format: Function
},
computed: {
Expand Down
23 changes: 23 additions & 0 deletions packages/select/src/option.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
disabled: {
type: Boolean,
default: false
},
selectedColor: {
type: String,
default: '#409EFF'
}
},

Expand Down Expand Up @@ -131,6 +135,24 @@
selectOptionClick() {
if (this.disabled !== true && this.groupDisabled !== true) {
this.dispatch('ElSelect', 'handleOptionClick', [this, true]);
if (this.selectedColor !== '#409EFF') {
// 如果不是默认的颜色
if (this.$el.className === 'el-select-dropdown__item selected hover' ||
this.$el.className === 'el-select-dropdown__item hover'
) {
let siblingsNode = this.$parent.$children;
siblingsNode.forEach(item=>{
if (item.$el.className === 'el-select-dropdown__item' ||
item.$el.className === 'el-select-dropdown__item selected') {
item.$el.style.color = '#606266';
}
});
this.$el.style.color = this.selectedColor;
} else {
this.$el.style.color = '#606266';
}

}
}
},

Expand All @@ -150,6 +172,7 @@

this.$on('queryChange', this.queryChange);
this.$on('handleGroupDisabled', this.handleGroupDisabled);

},

beforeDestroy() {
Expand Down