Breadcrumbs: emit 'navigate' event when clicking on the link
Clicking on the breadcrumb link now doesn't follow the link any more, but by keeping it as a link users can still open in a new tab.
This commit is contained in:
parent
d5a4c247b0
commit
1fd17303a5
@ -2,7 +2,7 @@ const TEMPLATE = `
|
||||
<div class='breadcrumbs' v-if="breadcrumbs.length">
|
||||
<ul>
|
||||
<li v-for="crumb in breadcrumbs">
|
||||
<a :href="crumb.url" v-if="!crumb._self">{{ crumb.name }}</a>
|
||||
<a :href="crumb.url" v-if="!crumb._self" @click.prevent="navigateToNode(crumb._id)">{{ crumb.name }}</a>
|
||||
<template v-else><span>{{ crumb.name }}</span></template>
|
||||
</li>
|
||||
</ul>
|
||||
@ -45,5 +45,8 @@ Vue.component("node-breadcrumbs", {
|
||||
})
|
||||
;
|
||||
},
|
||||
navigateToNode(nodeId) {
|
||||
this.$emit('navigate', nodeId);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user