页面里不是form表单
button按钮的函数如下:
setPass: function() {
window.location.href="setpass.vue?tel=" + this.user.phone;
}
每次点击按钮时跳转页面地址栏都有参数信息,请问用window.location.href
如何隐藏参数?谢谢
页面里不是form表单
button按钮的函数如下:
setPass: function() {
window.location.href="setpass.vue?tel=" + this.user.phone;
}
每次点击按钮时跳转页面地址栏都有参数信息,请问用window.location.href
如何隐藏参数?谢谢
get的话肯定是没办法隐藏参数,自己动态创建一个表单,表单method改为post,提交这个表单才行
setPass: function() {
var f=document.createElement('form');
f.style.display='none';
f.action='setpass.vue';
f.method='post';
f.innerHTML='<input type="hidden" name="tel" value="'+this.user.phone+'"/>';
document.body.appendChild(f);
f.submit();
//window.location.href="?tel=" + this.user.phone;
}