Skip to content

Commit

Permalink
docs: add example
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jul 25, 2022
1 parent a7cc127 commit c1c224c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/content/3.guide/1.writing/7.document-driven.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,40 @@ definePageMeta({
</script>
```

### Config content

You can pass custom path/query to `page` and `surround` options to config documentDriven content.

```html
<script setup lang="ts">
definePageMeta({
documentDriven: {
// Simple Path
page: '/foo',
// Rich Query
surround: {
_path: '/foo/bar'
}
}
})
</script>
```

::alert
If you change `page` option and leave `surround` unset, `surround` option will use same config and `page`.
```html
<script setup lang="ts">
definePageMeta({
documentDriven: {
page: {
_path: '/foo/bar'
},
// surround will use `{ _path: '/foo/bar' }`
}
})
</script>
```
::

## Example

Expand Down

0 comments on commit c1c224c

Please sign in to comment.