给含有关键词的label着色
- 给含有关键词的label着色
FineFileType() {
let arr = document.querySelectorAll('.el-checkbox__label');
for (let index = 0; index < arr.length; index++) {
const element = arr[index] as HTMLLabelElement;
let txt = element.innerText;
if (this.kyWord && txt.indexOf(this.kyWord) >= 0) {
element.style.color = 'red';
} else {
element.style.color = 'black';
}
}
}