Vue学习笔记
实现该项参数的获取要考虑以下几个方面的事情:1.浏览器是否满足ES5及ES6的问题2.要熟悉WEBAPI的一些内置函数及对象,如:https://developer.mozilla.org/zh-CN/docs/Web/API/Window/locationfunctionloadPageVar(sVar){returndecodeURI(window.location.search.replace(newRegExp("^(?:.*[&\\?]"+encodeURI(sVar).replace(/[\.\+\*]/g,"\\$&")+"(?:\\=([^&]*))?)?.*$","i"),"$1"));}console.log('路由URL:'+location)console.log('路由URL参数:'+loadPageVar("logintype"))本次总结如下: