]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
fix(devtools): stabilize record id (#897)
authorGuillaume Chau <guillaume.b.chau@gmail.com>
Tue, 20 Apr 2021 16:29:50 +0000 (18:29 +0200)
committerGitHub <noreply@github.com>
Tue, 20 Apr 2021 16:29:50 +0000 (18:29 +0200)
src/devtools.ts

index 43f2e1e857313270e2bc934c7cb1829dc387ff57..97677dabc1e5490cf9cb4837a971e39c0136426f 100644 (file)
@@ -435,8 +435,11 @@ function formatRouteRecordForInspector(
 
   // add an id to be able to select it. Using the `path` is not possible because
   // empty path children would collide with their parents
-  let id = String(routeRecordId++)
-  ;(record as any).__vd_id = id
+  let id = (record as any).__vd_id
+  if (id == null) {
+    id = String(routeRecordId++)
+    ;(record as any).__vd_id = id
+  }
 
   return {
     id,