Skip to content

Commit

Permalink
respect target="_blank" on links (fix #241)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 11, 2016
1 parent 696c7fd commit f223b25
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/directives/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ export default function (Vue) {
)
return
}
// no need to handle click if link expects to be opened
// in a new window/tab.
/* istanbul ignore if */
if (this.el.tagName === 'A' &&
this.el.getAttribute('target') === '_blank') {
return
}
// handle click
let router = vm.$route.router
this.handler = (e) => {
// don't redirect with control keys
Expand Down

0 comments on commit f223b25

Please sign in to comment.