2020
11-13
11-13
vue 获取url参数、get参数返回数组的操作
这是vue过滤器获取url参数,返回数组Vue.prototype.$url=function(){varurl=decodeURIComponent(location.search);//获取url中"?"符后的字串vartheRequest=newObject();if(url.indexOf("?")!=-1){varstr=url.substr(1);strs=str.split("&");for(vari=0;i<strs.length;i++){theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);}}returntheRequest;};补充知...
继续阅读 >