因为这样写,this.options[index].value并不会换成+6,而是直接把this.options[index].value当成字符串来
你可以这样this.Tracker.value.replace( new RegExp('\\'+this.options[index].value,'g'),"");
你可以这样this.Tracker.value.replace( new RegExp('\\'+this.options[index].value,'g'),"");
this.options[index].value为6:
this.Tracker.value.replace( new RegExp(this.options[index].value,'g'),"");
这样写有没有错???
illegal character
this.Tracker.value.replace( new RegExp( this.options[index].value,'g'),"");\n
Line 1705
你加个this.options[index].value.toString啊,默认的转换估计是把整数当成unicode值了, 要不然""+this.options[index].value