您好我有以下代码行,
var datos = svg.selectAll("circle")
.data(nowData)
.enter()
.append("circle")
.attr("cx", function(d) {
return xScale(d[0]);
})
.attr("cy", function(d) {
return yScale(d[1]);
})
.attr("r", function(d) {
return 5;
})
;
基本上是获取类名为for ( let x: number = 0; x < this._vcr.element.nativeElement.querySelectorAll(".ui-steps-item").length; x++) {
let className: any = this._vcr.element.nativeElement.querySelectorAll(".ui-steps-item")[x].className;
if(className != 'ui-steps-item ui-state-highlight'){
this._vcr.element.nativeElement.querySelectorAll(".ui-steps-item")[x].className += " btn-disable";
console.log(className);
}
// console.log(this._vcr.element.nativeElement.querySelectorAll(".ui-steps-item")[x].className);
}
的dom元素,并附加一个名为.ui-steps-item
的新类。但不知何故,第一个dom元素的类不会随着新类而改变。伙计们好吗?另外,如何在特定的dom元素之后附加类?在此先感谢你们