|
|
@ -1,5 +1,6 @@
|
|
|
|
import { reactive, inject, markRaw, nextTick, readonly } from 'vue'
|
|
|
|
import { reactive, inject, markRaw, nextTick, readonly } from 'vue'
|
|
|
|
import type { Component, InjectionKey } from 'vue'
|
|
|
|
import type { Component, InjectionKey } from 'vue'
|
|
|
|
|
|
|
|
import { lookup } from 'mrmime'
|
|
|
|
import { notFoundPageData } from '../shared'
|
|
|
|
import { notFoundPageData } from '../shared'
|
|
|
|
import type { PageData, PageDataPayload, Awaitable } from '../shared'
|
|
|
|
import type { PageData, PageDataPayload, Awaitable } from '../shared'
|
|
|
|
import { inBrowser, withBase } from './utils'
|
|
|
|
import { inBrowser, withBase } from './utils'
|
|
|
@ -181,7 +182,6 @@ export function createRouter(
|
|
|
|
link.baseURI
|
|
|
|
link.baseURI
|
|
|
|
)
|
|
|
|
)
|
|
|
|
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 &&
|
|
|
@ -191,7 +191,9 @@ export function createRouter(
|
|
|
|
!target &&
|
|
|
|
!target &&
|
|
|
|
origin === currentUrl.origin &&
|
|
|
|
origin === currentUrl.origin &&
|
|
|
|
// don't intercept if non-html extension is present
|
|
|
|
// don't intercept if non-html extension is present
|
|
|
|
!(extMatch && extMatch[0] !== '.html')
|
|
|
|
!(siteDataRef.value.cleanUrls
|
|
|
|
|
|
|
|
? lookup(pathname)
|
|
|
|
|
|
|
|
: lookup(pathname) !== 'text/html')
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
e.preventDefault()
|
|
|
|
e.preventDefault()
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|