阻止router-link 跳转 以及打开新页面
作者:互联网
router-link
不满足条件时阻止跳转 $route.fullPath 不进行跳转 <router-link :to="row.enabled ? {path: $route.fullPath} : {path:'/dt-exchange/dt-detail',query:{jobId:row.id,page_no:page_no,desc:form.work_describe}}"></router-link> 如果想要另开窗口的话通过 :target="_blank" 默认是_self 虽然说vue的router-link不支持target属性 但可以解决此问题 满足条件打开新窗口跳转,不满足时不进行跳转 <router-link :to="row.enabled ? {path: $route.fullPath} : {path:'/dt-exchange/dt-detail',query:{jobId:row.id,page_no:page_no,desc:form.work_describe}}" :target="row.enabled ? '_self' : '_blank'"></router-link>
标签:满足条件,target,新页面,阻止,link,跳转,router 来源: https://www.cnblogs.com/bu1204/p/15432727.html