Js前端-路由管理器函数
作者:互联网
buildUrl:function( path ,params ){
let url = "" + path;
let _paramUrl = "";
if( params ){
_paramUrl = Object.keys( params ).map( function( k ){
return [ encodeURIComponent( k ),encodeURIComponent( params[ k ] ) ].join("=");
}).join("&");
_paramUrl = "?" + _paramUrl;
}
return url + _paramUrl;
}
标签:function,管理器,url,paramUrl,Js,params,join,encodeURIComponent,路由 来源: https://www.cnblogs.com/1fengchen1/p/15617329.html