更改el-select-dropdown_item selected選中顏色
默認(rèn)為element主題色
在修改element select下拉框選中顏色時會發(fā)現(xiàn)不生效,原因是:el-select下拉框插入到了body中
解決辦法:
在select標(biāo)簽里填寫:popper-append-to-body="false"屬性,禁止select下拉框插入到body中
<el-select
v-model="value"
@change="changeProjectStatus"
placeholder="請選擇"
:popper-append-to-body="false">
<el-option
v-for="item in tabOptions"
:key="item.status"
:label="item.label"
:value="item.status">
</el-option>
</el-select>
然后更改選中元素的顏色,就可以了文章來源:http://www.zghlxwxcb.cn/news/detail-595501.html
::v-deep .el-select-dropdown__list .selected{
color: #2e49ad;
}
但是,我在另一個組件中寫了卻不起作用(像是被下面的元素遮擋了),最后寫在了全局樣式里,才顯現(xiàn)出來,不知道什么原因?文章來源地址http://www.zghlxwxcb.cn/news/detail-595501.html
到了這里,關(guān)于更改el-select-dropdown_item selected選中顏色的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!