mounted(){
this.getClass() //初始化引用
}
getClass(){
var odiv = document.getElementsByTagName("*");
for(var i = 0; i<odiv.length; i++){
if(odiv[i].className == 'van-action-sheet__name'){
let val = odiv[i].innerText;
if(val && val.length>14){
let prevVal = val.substring(0,11);
let nextVal = val.substring(11,val.length);
odiv[i].innerHTML = `${prevVal}<span style='color:#568fff'> ${nextVal} </span>`
}
}
}
},
OR
let divsToHide = document.getElementsByClassName("el-popper"); //divsToHide is an array
for(let i = 0; i < divsToHide.length; i++){
// divsToHide[i].style.visibility = "hidden"; // or
divsToHide[i].style.display = "none"; // depending on what you're doing
}