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

README.md

15 lines729 Bytes

1# TanStack Vue Query Shadow DOM Example
2​
3Renders the app and the devtools inside a shadow root.
4​
5## How it works
6​
7- `src/services/dogs/queries.ts` defines `dogsQueries.list()`, a `queryOptions` factory keyed by `['dogs', 'list']` that fetches all breeds from the Dog API.
8- `src/DogList.vue` reads it with `useQuery(dogsQueries.list())` and lists the breed names.
9- `src/main.ts` attaches an open shadow root to `#app`, installs `VueQueryPlugin`, mounts the app into a container inside that shadow root, and passes the root as the `shadowRoot` prop.
10- `src/App.vue` passes that root to `VueQueryDevtools` as `shadow-d-o-m-target`, with the toggle button at the bottom left.
11​
12To run this example:
13​
14- `npm install`
15- `npm run dev`