File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed
packages/vue-devtools/src Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 11<script lang="ts">
22import { defineComponent , ref } from ' vue'
3- import { TanStackDevtools } from ' @tanstack/vue-devtools'
3+ import {
4+ TanStackDevtools ,
5+ TanStackDevtoolsVuePlugin ,
6+ } from ' @tanstack/vue-devtools'
47import { VueQueryDevtoolsPanel } from ' @tanstack/vue-query-devtools'
58
69import Posts from ' ./Posts.vue'
@@ -19,7 +22,12 @@ export default defineComponent({
1922 postId .value = id
2023 }
2124
22- const plugins = [{ name: ' Vue Query' , component: VueQueryDevtoolsPanel }]
25+ const plugins: TanStackDevtoolsVuePlugin [] = [
26+ {
27+ name: ' Vue Query' ,
28+ component: VueQueryDevtoolsPanel ,
29+ },
30+ ]
2331
2432 return {
2533 isVisited ,
Original file line number Diff line number Diff line change @@ -2,13 +2,10 @@ import type { Component } from 'vue'
22import type {
33 ClientEventBusConfig ,
44 TanStackDevtoolsConfig ,
5- TanStackDevtoolsPlugin ,
65} from '@tanstack/devtools'
76
8- export type TanStackDevtoolsVuePlugin = Omit <
9- TanStackDevtoolsPlugin ,
10- 'render' | 'name'
11- > & {
7+ export type TanStackDevtoolsVuePlugin = {
8+ id ?: string
129 component : Component
1310 name : string | Component
1411 props ?: Record < string , any >
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ import type {
1010const props = defineProps <TanStackDevtoolsVueInit >()
1111
1212const titlesToRender = shallowRef <Array <{ id: string ; component: any }>>([])
13- const pluginsToRender = shallowRef <Array <{ id: string ; component: any }>>([])
13+ const pluginsToRender = shallowRef <
14+ Array < { id : string ; component : any ; props : any }>
15+ > ([])
1416const div = ref <HTMLElement >()
1517
1618function getPlugin(plugin : TanStackDevtoolsVuePlugin ): TanStackDevtoolsPlugin {
@@ -33,7 +35,7 @@ function getPlugin(plugin: TanStackDevtoolsVuePlugin): TanStackDevtoolsPlugin {
3335 const id = e .getAttribute (' id' )!
3436 pluginsToRender .value = [
3537 ... pluginsToRender .value ,
36- { id , component: plugin .component },
38+ { id , component: plugin .component , props: plugin . props },
3739 ]
3840 },
3941 destroy : (pluginId ) => {
@@ -83,6 +85,6 @@ onScopeDispose(() => {
8385 :key =" plugin.id"
8486 :to =" '#' + plugin.id"
8587 >
86- <component :is =" plugin.component" />
88+ <component :is =" plugin.component" v-bind = " plugin.props " />
8789 </Teleport >
8890</template >
You can’t perform that action at this time.
0 commit comments