Navigation Menu

Skip to content

Commit

Permalink
fix(history): make properties enumerable
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 2, 2021
1 parent d90520e commit 8e6ebdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/history/html5.ts
Expand Up @@ -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,
})

Expand Down
1 change: 1 addition & 0 deletions src/history/memory.ts
Expand Up @@ -95,6 +95,7 @@ export function createMemoryHistory(base: string = ''): RouterHistory {
}

Object.defineProperty(routerHistory, 'location', {
enumerable: true,
get: () => queue[position],
})

Expand Down

0 comments on commit 8e6ebdf

Please sign in to comment.