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/framework/vue/devtools.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ bun add @tanstack/vue-query-devtools
44
44
45
45
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.
46
46
47
+
## Floating Mode
48
+
47
49
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.
48
50
49
51
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!
@@ -79,6 +81,47 @@ import { VueQueryDevtools } from '@tanstack/vue-query-devtools'
79
81
- Default behavior will apply the devtool's styles to the head tag within the DOM.
80
82
- Use this to pass a shadow DOM target to the devtools so that the styles will be applied within the shadow DOM instead of within the head tag in the light DOM.
81
83
84
+
## Embedded Mode
85
+
86
+
Embedded mode will show the development tools as a fixed element in your application, so you can use our panel in your own development tools.
87
+
88
+
Place the following code as high in your React app as you can. The closer it is to the root of the page, the better it will work!
89
+
90
+
```vue
91
+
<script setup>
92
+
import { VueQueryDevtoolsPanel } from '@tanstack/vue-query-devtools'
- 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.
119
+
-`styleNonce?: string`
120
+
- 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.
121
+
-`shadowDOMTarget?: ShadowRoot`
122
+
- Default behavior will apply the devtool's styles to the head tag within the DOM.
123
+
- Use this to pass a shadow DOM target to the devtools so that the styles will be applied within the shadow DOM instead of within the head tag in the light DOM.
124
+
82
125
## Traditional Devtools
83
126
84
127
Vue Query will seamlessly integrate with the [Official Vue devtools](https://github.com/vuejs/devtools-next), adding custom inspector and timeline events.
* Use this so you can define custom errors that can be shown in the devtools.
54
+
*/
55
+
errorTypes?: Array<DevtoolsErrorType>
56
+
/**
57
+
* 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.
58
+
*/
59
+
styleNonce?: string
60
+
/**
61
+
* Use this so you can attach the devtool's styles to specific element in the DOM.
62
+
*/
63
+
shadowDOMTarget?: ShadowRoot
64
+
65
+
/**
66
+
* Custom styles for the devtools panel
67
+
* @default { height: '500px' }
68
+
* @example { height: '100%' }
69
+
* @example { height: '100%', width: '100%' }
70
+
*/
71
+
style?: React.CSSProperties
72
+
73
+
/**
74
+
* Callback function that is called when the devtools panel is closed
75
+
*/
76
+
onClose?: ()=>unknown
77
+
/**
78
+
* Set this to true to hide disabled queries from the devtools panel.
0 commit comments