首页 > 代码库 > string字符串替换

string字符串替换

let parmId =self.$route.path.replace(/.+\?cid=(.*)\&states=(.*)\&potion=(.+)\&url=(.+)/g,"$1");//获取传递Id
let states = self.$route.path.replace(/.+\?cid=(.*)\&states=(.*)\&potion=(.+)\&url=(.+)/g,"$2");//状态
let potion = self.$route.path.replace(/.+\?cid=(.*)\&states=(.*)\&potion=(.+)\&url=(.+)/g,"$3");//获取传递内容
let parm = "?activityId="+parmId+"&option="+states;
self.url = self.$route.path.replace(/.+\?cid=(.*)\&states=(.*)\&potion=(.+)\&url=(.+)/g,"$4");//获取上个路径的url参数

string字符串替换