examples/vue/shadow-dom
| Name | Last commit message | Last commit date |
|---|---|---|
| .. | ||
README.md
TanStack Vue Query Shadow DOM Example#
Renders the app and the devtools inside a shadow root.
How it works#
src/services/dogs/queries.tsdefinesdogsQueries.list(), aqueryOptionsfactory keyed by['dogs', 'list']that fetches all breeds from the Dog API.src/DogList.vuereads it withuseQuery(dogsQueries.list())and lists the breed names.src/main.tsattaches an open shadow root to#app, installsVueQueryPlugin, mounts the app into a container inside that shadow root, and passes the root as theshadowRootprop.src/App.vuepasses that root toVueQueryDevtoolsasshadow-d-o-m-target, with the toggle button at the bottom left.
To run this example:
npm installnpm run dev