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/en/guide/routing.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -336,6 +336,46 @@ export default {
336
336
}
337
337
```
338
338
339
+
### Watching Template and Data Files
340
+
341
+
When generating page content from templates or external data sources, you can use the watch option to automatically rebuild pages when those files change during development:
content:renderTemplate(data) // Use template to generate content
366
+
}
367
+
})
368
+
}
369
+
}
370
+
```
371
+
372
+
The `watch` option works the same way as in [data loaders](./data-loading#data-from-local-files):
373
+
374
+
- Accepts [glob patterns](https://github.com/mrmlnc/fast-glob#pattern-syntax) to match files
375
+
- Patterns are relative to the `.paths.js` file itself
376
+
- Changes to watched files trigger page regeneration and HMR during development
377
+
- In production builds, all pages are generated once regardless of watch configuration
378
+
339
379
### Accessing Params in Page
340
380
341
381
You can use the params to pass additional data to each page. The Markdown route file can access the current page params in Vue expressions via the `$params` global property:
0 commit comments