1. 由zz_text1页面跳转到zz_text2页面
2. zz_text1页面代码
<button style="width: 1rem;height: 0.6rem;line-height: 0.6rem;text-align: center;" @click="GoPage">跳转</button>
GoPage(){ window.location.href="./zz_text2.html?id="+'1'+'&age='+'23' }
3. zz_text2页面代码
var url = decodeURIComponent(location.search); var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); var strs = str.split("&"); for(var i = 0; i < strs.length; i ++) { theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]); } } console.log(url) console.log(theRequest.id) console.log(theRequest.age)
4. 效果图