1- import {
2- App ,
1+ import { setupDevtoolsPlugin } from '@vue/devtools-api'
2+ import type {
33 CustomInspectorNode ,
44 InspectorNodeTag ,
55 CustomInspectorState ,
6- HookPayloads ,
7- setupDevtoolsPlugin ,
86 TimelineEvent ,
9- } from '@vue/devtools-api '
10- import { watch } from 'vue'
7+ } from '@vue/devtools-kit '
8+ import { type App , watch } from 'vue'
119import { decode } from './encoding'
1210import { isSameRouteRecord } from './location'
1311import { RouterMatcher } from './matcher'
@@ -18,7 +16,6 @@ import { UseLinkDevtoolsContext } from './RouterLink'
1816import { RouterViewDevtoolsContext } from './RouterView'
1917import { assign , isArray } from './utils'
2018import { RouteLocationNormalized } from './typed-routes'
21- import { warn } from './warning'
2219
2320/**
2421 * Copies a route location and removes any problematic properties that cannot be shown in devtools (e.g. Vue instances).
@@ -80,14 +77,8 @@ export function addDevtools(app: App, router: Router, matcher: RouterMatcher) {
8077 app,
8178 } ,
8279 api => {
83- if ( typeof api . now !== 'function' ) {
84- warn (
85- '[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.'
86- )
87- }
88-
8980 // display state added by the router
90- api . on . inspectComponent ( ( payload , ctx ) => {
81+ api . on . inspectComponent ( payload => {
9182 if ( payload . instanceData ) {
9283 payload . instanceData . state . push ( {
9384 type : 'Routing' ,
@@ -299,7 +290,11 @@ export function addDevtools(app: App, router: Router, matcher: RouterMatcher) {
299290 payload . rootNodes = routes . map ( formatRouteRecordForInspector )
300291 }
301292
302- let activeRoutesPayload : HookPayloads [ 'getInspectorTree' ] | undefined
293+ type GetInspectorTreePayload = Parameters <
294+ Parameters < typeof api . on . getInspectorTree > [ 0 ]
295+ > [ 0 ]
296+
297+ let activeRoutesPayload : GetInspectorTreePayload | undefined
303298 api . on . getInspectorTree ( payload => {
304299 activeRoutesPayload = payload
305300 if ( payload . app === app && payload . inspectorId === routerInspectorId ) {
0 commit comments