Skip to content
Source
Sign inSign up
TanStack/devtools
Open History to see the last commit

basic-setup.md

62 lines1.9 KB

1---
2title: Basic setup
3id: basic-setup
4---
5​
6TanStack Devtools provides you with an easy-to-use and modular client that allows you to compose multiple devtools into one easy-to-use panel.
7​
8## Setup
9​
10Install the [TanStack Devtools](https://www.npmjs.com/package/@tanstack/vue-devtools) library. This will install the devtools core as well as provide you with the Vue-specific adapter.
11​
12```bash
13npm i @tanstack/vue-devtools
14```
15​
16Next, in the root of your application, import the `TanStackDevtools` component from `@tanstack/vue-devtools` and add it to your template.
17​
18```vue
19<script setup lang="ts">
20import { TanStackDevtools } from '@tanstack/vue-devtools'
21</script>
22​
23<template>
24 <App />
25 <TanStackDevtools />
26</template>
27```
28​
29Import the desired devtools and provide them to the `TanStackDevtools` component via the `plugins` prop along with a label for the menu.
30​
31Currently TanStack offers:
32​
33- `VueQueryDevtoolsPanel`
34​
35```vue
36<script setup lang="ts">
37import { TanStackDevtools } from '@tanstack/vue-devtools'
38import type { TanStackDevtoolsVuePlugin } from '@tanstack/vue-devtools'
39import { VueQueryDevtoolsPanel } from '@tanstack/vue-query-devtools'
40​
41const plugins: TanStackDevtoolsVuePlugin[] = [
42 {
43 name: 'Vue Query',
44 component: VueQueryDevtoolsPanel,
45 },
47</script>
48​
49<template>
50 <App />
51 <TanStackDevtools
52 :eventBusConfig="{ connectToServerBus: true }"
53 :plugins="plugins"
54 />
55</template>
56```
57​
58> Note: The Vue adapter uses `component` instead of `render` in plugin definitions. In Vue, components are passed as component references rather than JSX elements, and any additional props can be provided via the `props` field.
59​
60Finally, add any additional configuration you desire to the `TanStackDevtools` component. More information can be found under the [TanStack Devtools Configuration](../../configuration) section.
61​
62A complete working example can be found in our [basic example](https://tanstack.com/devtools/latest/docs/framework/vue/examples/basic).