如何绕过beforerouteleave nuxtjs组件
我使用beforerouteleave
用于打开的对话框组件
使用router
调用组件时。
beforeRouteLeave(to, from, next) {
if (to.name === "read-content") {
this.displayProductModal(to);
} else {
next();
}
},
当我将nux-link调用read-content
(route.name)页面时,对话框打开。有时我不想运行对话框。但是我想直接访问该页面,该怎么办?
I use beforeRouteLeave
for open dialog component
when calling component with router
.
beforeRouteLeave(to, from, next) {
if (to.name === "read-content") {
this.displayProductModal(to);
} else {
next();
}
},
When I call nuxt-link to the read-content
(route.name) page a dialog opens. Sometimes I don't want to run the dialog. But I want to access that page directly, what should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了答案,我在参数
中使用条件
- >if(to.hash)
在route> outder/#
url 。如果还有其他更好的方法,请建议我。
I found my answer, i use condition in parameter
to
->if(to.hash)
add token or fake param afterroute/#
url.If there is any other better way please suggest me.