You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/vue/devtools.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,3 +11,52 @@ The only thing you need to do is to install the official **[Vue Devtools](https:
11
11
12
12
Vue Query will seamlessly integrate with the official devtools, adding custom inspector and timeline events.
13
13
Devtool code will be treeshaken from production bundles by default.
14
+
15
+
## Component based Devtools (Vue 3)
16
+
17
+
You can embeed devtools component into your page by using dedicated package.
18
+
Component based devtools are using the same framework-agnostic implementation, have more features and are updated more frequently.
19
+
20
+
The devtools component is a separate package that you need to install:
21
+
22
+
```bash
23
+
$ npm i @tanstack/vue-query-devtools
24
+
# or
25
+
$ pnpm add @tanstack/vue-query-devtools
26
+
# or
27
+
$ yarn add @tanstack/vue-query-devtools
28
+
```
29
+
30
+
By default, Vue Query Devtools are only included in bundles when `process.env.NODE_ENV === 'development'`, so you don't need to worry about excluding them during a production build.
31
+
32
+
Devtools will be mounted as a fixed, floating element in your app and provide a toggle in the corner of the screen to show and hide the devtools. This toggle state will be stored and remembered in localStorage across reloads.
33
+
34
+
Place the following code as high in your Vue app as you can. The closer it is to the root of the page, the better it will work!
35
+
36
+
```vue
37
+
<script setup>
38
+
import { VueQueryDevtools } from '@tanstack/vue-query-devtools'
39
+
</script>
40
+
41
+
<template>
42
+
<h1>The app!</h1>
43
+
<VueQueryDevtools />
44
+
</template>
45
+
```
46
+
47
+
### Options
48
+
49
+
-`initialIsOpen: Boolean`
50
+
- Set this `true` if you want the dev tools to default to being open
- Use this to predefine some errors that can be triggered on your queries. Initializer will be called (with the specific query) when that error is toggled on from the UI. It must return an Error.
61
+
-`styleNonce?: string`
62
+
- Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
* Use this so you can define custom errors that can be shown in the devtools.
31
+
*/
32
+
errorTypes?: Array<DevToolsErrorType>
33
+
/**
34
+
* Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
0 commit comments