//关闭分享按钮 清空url携带参数
closeShare(){
this.locationShowShare = false; // 修改本地数据属性而不是prop
this.$emit('update:showPopup', this.locationShowShare); // 触发事件更新prop
const currentPath = this.$route.fullPath;
const targetPath = '/singlePage/officialAccounts/person/home/home';
console.log(currentPath);
if (currentPath !== targetPath) {
this.$router.replace({ path: targetPath });
}
}
适用地方判断是否是分享链接,关闭或点击之后需要把参数消除
$route.fullPath后面可以携带参数
singlePage/officialAccounts/person/personLogin?InsurePhone=***&PC_ID=121
$route.path后面只是跟着地址
singlePage/officialAccounts/person/personLogin