From 6ea0516008aa1786eeebc86f14bbb4529a106ebd Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Mon, 18 Sep 2023 14:31:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=99=A8=E7=BB=84=E4=BB=B6=E8=8E=B7=E5=8F=96=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E5=B9=B6=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-room-ui/packages/BasicComponents/Select/index.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/data-room-ui/packages/BasicComponents/Select/index.vue b/data-room-ui/packages/BasicComponents/Select/index.vue index efd16062..561f32d2 100644 --- a/data-room-ui/packages/BasicComponents/Select/index.vue +++ b/data-room-ui/packages/BasicComponents/Select/index.vue @@ -146,6 +146,7 @@ export default { selectDropdownIcon.style.fontSize = config.customize.fontSize + 'px' // 选择器下拉框元素 const selectDropdownEl = document.querySelector(`.select-${config.code} .el-select-dropdown`) + console.log('selectDropdownEl', selectDropdownEl) // 箭头背景颜色和下拉框背景颜色一致 if (selectDropdownEl) { // 下拉框无边框 @@ -169,12 +170,9 @@ export default { selectDropdownEmptyEl.style.backgroundColor = this.innerConfig.customize.dropDownBackgroundColor } // 下拉项hover颜色 - const selectDropdownItemEl = document.querySelectorAll(`.select-popper-${this.innerConfig.code} .el-select-dropdown__item`) - // 给--dropDownHoverFontColor 和 --dropDownHoverBackgroundColor 赋值 - selectDropdownItemEl.forEach(item => { - item.style.setProperty('--dropDownHoverFontColor', this.innerConfig.customize.dropDownHoverFontColor) - item.style.setProperty('--dropDownHoverBackgroundColor', this.innerConfig.customize.dropDownHoverBackgroundColor) - }) + const selectDropdownWrap = document.querySelector(`.select-popper-${this.innerConfig.code} .el-select-dropdown__wrap`) + selectDropdownWrap.style.setProperty('--dropDownHoverFontColor', this.innerConfig.customize.dropDownHoverFontColor) + selectDropdownWrap.style.setProperty('--dropDownHoverBackgroundColor', this.innerConfig.customize.dropDownHoverBackgroundColor) } // 不是激活项的还是使用背景颜色 const selectDropdownItemEl = document.querySelectorAll(`.select-popper-${this.innerConfig.code} .el-select-dropdown__item`)