11import { defineNuxtPlugin , useRouter } from '#imports'
22import { triggerRef } from 'vue'
3- import { useClient , useComponentInspectorData } from '../composables/client'
3+ import { useClient } from '../composables/client'
44import { rpc } from '../composables/rpc'
55
66export default defineNuxtPlugin ( ( ) => {
77 const client = useClient ( )
8- const inspectorData = useComponentInspectorData ( )
98 const router = useRouter ( )
109
1110 function onUpdateReactivity ( ) {
1211 triggerRef ( client )
1312 client . value . revision . value += 1
1413 }
1514
16- function onInspectorUpdate ( data : any ) {
17- inspectorData . value = data
18- }
19-
20- function onInspectorClick ( url : URL ) {
21- const query = url . searchParams . get ( 'file' )
22- if ( query )
23- rpc . openInEditor ( query )
24- else
25- console . error ( '[nuxt-devtools] Failed to open file from Vue Inspector' , url )
15+ function onInspectorClick ( path : string ) {
16+ rpc . openInEditor ( path )
2617 }
2718
2819 Object . defineProperty ( window , '__NUXT_DEVTOOLS_VIEW__' , {
@@ -34,7 +25,6 @@ export default defineNuxtPlugin(() => {
3425 client . value = _client
3526
3627 _client . hooks . hook ( 'host:update:reactivity' , onUpdateReactivity )
37- _client . hooks . hook ( 'host:inspector:update' , onInspectorUpdate )
3828 _client . hooks . hook ( 'host:inspector:click' , onInspectorClick )
3929 _client . hooks . hook ( 'host:action:reload' , ( ) => location . reload ( ) )
4030 _client . hooks . hook ( 'host:action:navigate' , ( path : string ) => router . push ( path ) )
0 commit comments