We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 473b25d commit 1961d35Copy full SHA for 1961d35
src/history/html5.js
@@ -2,6 +2,7 @@
2
3
import type VueRouter from '../index'
4
import { assert } from '../util/warn'
5
+import { inBrowser } from '../util/dom'
6
import { cleanPath } from '../util/path'
7
import { History } from './base'
8
import {
@@ -12,7 +13,10 @@ import {
12
13
getElementPosition
14
} from '../util/scroll-position'
15
-const genKey = () => String(Date.now())
16
+// use User Timing api (if present) for more accurate key precision
17
+const Time = inBrowser ? (window.performance || Date) : Date
18
+
19
+const genKey = () => String(Time.now())
20
let _key: string = genKey()
21
22
export class HTML5History extends History {
0 commit comments