Skip to content

Commit 2d29e6e

Browse files
authored
docs: add how list all route paragraph 🌶 (#7883)
* docs: add how list all route paragraph 🌶 * docs: improve description * Revert "docs: improve description" This reverts commit 07883ab. * docs: improve description
1 parent 9876fa7 commit 2d29e6e

File tree

1 file changed

+13
-0
lines changed
  • packages/docs/src/routes/docs/(qwikcity)/api

1 file changed

+13
-0
lines changed

‎packages/docs/src/routes/docs/(qwikcity)/api/index.mdx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,19 @@ The `routeAction$()` function is used to declare a new Server Action in the give
276276

277277
Please refer to the [Server Actions](/docs/(qwikcity)/action/index.mdx) section for more information.
278278

279+
## List all routes with qwikCityPlan.routes
280+
281+
The `qwikCityPlan.routes` property is used to retrieve the route list of your application.
282+
283+
```tsx
284+
import qwikCityPlan from '@qwik-city-plan';
285+
286+
const routes = qwikCityPlan.routes;
287+
for (const route of routes) {
288+
// your logic here
289+
}
290+
```
291+
279292
## `<QwikCityProvider>`
280293

281294
The `QwikCityProvider` component initializes Qwik City in the existing document, providing the necessary context for Qwik City to work, such as [`useContent()`](/docs/(qwikcity)/api/index.mdx#usecontent) and `useLocation()`.

0 commit comments

Comments
 (0)