From 8e6ebdf75adc1ab662e46835c5b7f078bc68a93b Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Sun, 2 May 2021 18:16:27 +0200 Subject: [PATCH] fix(history): make properties enumerable --- src/history/html5.ts | 2 ++ src/history/memory.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/history/html5.ts b/src/history/html5.ts index c17dc08b1..3b4c8be38 100644 --- a/src/history/html5.ts +++ b/src/history/html5.ts @@ -333,10 +333,12 @@ export function createWebHistory(base?: string): RouterHistory { ) Object.defineProperty(routerHistory, 'location', { + enumerable: true, get: () => historyNavigation.location.value, }) Object.defineProperty(routerHistory, 'state', { + enumerable: true, get: () => historyNavigation.state.value, }) diff --git a/src/history/memory.ts b/src/history/memory.ts index f3dfec60f..4187cf771 100644 --- a/src/history/memory.ts +++ b/src/history/memory.ts @@ -95,6 +95,7 @@ export function createMemoryHistory(base: string = ''): RouterHistory { } Object.defineProperty(routerHistory, 'location', { + enumerable: true, get: () => queue[position], })