Skip to content

Commit

Permalink
fix(nav-link): absolute links are passed to vue router
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Jan 9, 2023
1 parent 982aa83 commit 221e320
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/components/nav-link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,6 @@ const hasAnchor = computed(() => {
return props.href.includes('#')
})
const isNonHttpLink = computed(() => {
const containsProtocol = props.href.includes('://')
if (containsProtocol) {
return props.href.startsWith('http') === false
} else {
return false
}
})
const rel = computed(() => {
if (isExternalLink.value) {
return 'noopener noreferrer'
Expand Down Expand Up @@ -171,9 +162,7 @@ function click(event) {
}
}
if (hasAnchor.value || isNonHttpLink.value || isExternalLink.value) {
// let the browser do the work
} else {
if (isRelativeLink.value) {
event.preventDefault()
event.stopImmediatePropagation()
router.push(props.href)
Expand Down

0 comments on commit 221e320

Please sign in to comment.