import { extractComponentsGuards, guardToPromiseFn } from './utils'
import { encodeParam } from './utils/encoding'
import { decode } from './utils/encoding'
-import { ref, Ref } from '@vue/reactivity'
+import { ref, Ref, markNonReactive } from '@vue/reactivity'
type ErrorHandler = (error: any) => any
// resolve, reject arguments of Promise constructor
else history.push(url)
const from = currentRoute.value
- currentRoute.value = toLocation
+ currentRoute.value = markNonReactive(toLocation)
updateReactiveRoute()
handleScroll(toLocation, from).catch(err => triggerError(err, false))
}
// accept current navigation
- currentRoute.value = {
+ currentRoute.value = markNonReactive({
...to,
...matchedRoute,
- }
+ })
updateReactiveRoute()
// TODO: refactor with a state getter
// const { scroll } = history.state
// already contains current location
const from = currentRoute.value
- currentRoute.value = toLocation
+ currentRoute.value = markNonReactive(toLocation)
updateReactiveRoute()
// navigation is confirmed, call afterGuards
import { HistoryQuery, RawHistoryQuery } from '../history/common'
import { PathParserOptions } from '../matcher/path-parser-ranker'
+import { markNonReactive } from '@vue/reactivity'
// type Component = ComponentOptions<Vue> | typeof Vue | AsyncComponent
| RouteRecordRedirect
// TODO: this should probably be generate by ensureLocation
-export const START_LOCATION_NORMALIZED: RouteLocationNormalized = {
- path: '/',
- name: undefined,
- params: {},
- query: {},
- hash: '',
- fullPath: '/',
- matched: [],
- meta: {},
-}
+export const START_LOCATION_NORMALIZED: RouteLocationNormalized = markNonReactive(
+ {
+ path: '/',
+ name: undefined,
+ params: {},
+ query: {},
+ hash: '',
+ fullPath: '/',
+ matched: [],
+ meta: {},
+ }
+)
// make matched non enumerable for easy printing
Object.defineProperty(START_LOCATION_NORMALIZED, 'matched', {