From: Guillaume Chau Date: Tue, 20 Apr 2021 16:29:50 +0000 (+0200) Subject: fix(devtools): stabilize record id (#897) X-Git-Tag: v4.0.7~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6460f09aab3a834121dc58fc5880c81a65147ef;p=thirdparty%2Fvuejs%2Frouter.git fix(devtools): stabilize record id (#897) --- diff --git a/src/devtools.ts b/src/devtools.ts index 43f2e1e8..97677dab 100644 --- a/src/devtools.ts +++ b/src/devtools.ts @@ -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,