|
|
@ -114,6 +114,7 @@ export function createRouter(
|
|
|
|
if (link) {
|
|
|
|
if (link) {
|
|
|
|
const { href, protocol, hostname, pathname, hash, target } = link
|
|
|
|
const { href, protocol, hostname, pathname, hash, target } = link
|
|
|
|
const currentUrl = window.location
|
|
|
|
const currentUrl = window.location
|
|
|
|
|
|
|
|
const extMatch = pathname.match(/\.\w+$/)
|
|
|
|
// only intercept inbound links
|
|
|
|
// only intercept inbound links
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
!e.ctrlKey &&
|
|
|
|
!e.ctrlKey &&
|
|
|
@ -122,7 +123,8 @@ export function createRouter(
|
|
|
|
!e.metaKey &&
|
|
|
|
!e.metaKey &&
|
|
|
|
target !== `_blank` &&
|
|
|
|
target !== `_blank` &&
|
|
|
|
protocol === currentUrl.protocol &&
|
|
|
|
protocol === currentUrl.protocol &&
|
|
|
|
hostname === currentUrl.hostname
|
|
|
|
hostname === currentUrl.hostname &&
|
|
|
|
|
|
|
|
!(extMatch && extMatch[0] !== '.html')
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
e.preventDefault()
|
|
|
|
e.preventDefault()
|
|
|
|
if (pathname === currentUrl.pathname) {
|
|
|
|
if (pathname === currentUrl.pathname) {
|
|
|
|