|
|
@ -1,6 +1,7 @@
|
|
|
|
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 { PageData } from '../../../types/shared'
|
|
|
|
import { PageData } from '../../../types/shared'
|
|
|
|
|
|
|
|
import { inBrowser } from './utils'
|
|
|
|
|
|
|
|
|
|
|
|
export interface Route {
|
|
|
|
export interface Route {
|
|
|
|
path: string
|
|
|
|
path: string
|
|
|
@ -38,7 +39,6 @@ export function createRouter(
|
|
|
|
fallbackComponent?: Component
|
|
|
|
fallbackComponent?: Component
|
|
|
|
): Router {
|
|
|
|
): Router {
|
|
|
|
const route = reactive(getDefaultRoute())
|
|
|
|
const route = reactive(getDefaultRoute())
|
|
|
|
const inBrowser = typeof window !== 'undefined'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function go(href: string = inBrowser ? location.href : '/') {
|
|
|
|
function go(href: string = inBrowser ? location.href : '/') {
|
|
|
|
// ensure correct deep link so page refresh lands on correct files.
|
|
|
|
// ensure correct deep link so page refresh lands on correct files.
|
|
|
|