1class Route{ 2 //è·åè·¯ç±ä¼ åï¼æ ¹æ®ä¼ å ¥åæ°ä½ä¸ºkeyå¼ï¼è¿åvalueå¼ 3 /*static getQueryString(name){ 4 const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); 5 const search = window.location.search.split('?')[1] || ''; 6 const r = search.match(reg) || []; 7 return r[2]; 8 }*/ 9 //è·åè·¯ç±ä¼ åï¼å°åæ°è½¬å为对象ï¼è¿å该对象 10 static getQueryObject(){ 11 var url = location.search //è·åurlä¸"?"符åçå串 <a href="tel:400-888-6633">æ¨æçµè¯<a> 12 var routeQuery = {} 13 if (url.indexOf("?") != -1) { 14 var str = decodeURIComponent(url.substr(1)) 15 var strs = str.split("&") 16 for (var i = 0; i < strs.length; i++) { 17 routeQuery[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]) 18 } 19 } 20 return routeQuery 21 } 22} 23export default Route
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.