MCPcopy Create free account
hub / github.com/TanStack/devtools / setup

Function setup

packages/devtools-utils/src/vue/panel.ts:25–50  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

23 const Panel = defineComponent({
24 props,
25 setup(config) {
26 const devToolRef = ref<HTMLElement | null>(null)
27 const devtools = ref<TCoreDevtoolsClass | null>(null)
28
29 onMounted(() => {
30 const instance = new CoreClass(config.devtoolsProps as TComponentProps)
31 devtools.value = instance
32
33 if (devToolRef.value) {
34 instance.mount(devToolRef.value, config.props)
35 }
36 })
37
38 onUnmounted(() => {
39 if (devToolRef.value && devtools.value) {
40 devtools.value.unmount()
41 }
42 })
43
44 return () => {
45 return h('div', {
46 style: { height: '100%' },
47 ref: devToolRef,
48 })
49 }
50 },
51 })
52
53 const NoOpPanel = defineComponent({

Callers

nothing calls this directly

Calls 2

mountMethod · 0.45
unmountMethod · 0.45

Tested by

no test coverage detected