微信小程序vuex里面使用replace一直报错呢

var changeText=function(text){
 return text.replace(/\n/g," ");
}

写了一个方法想把里面的换行符都换成空格却在报错

然后我又改成这样

var changeText=function(text){

text.replace(getRegExp('\n','g')," ");

}

猜你喜欢

转载自blog.csdn.net/qq_33769914/article/details/128018583
今日推荐