File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
docs/content/docs/3.files Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -46,14 +46,20 @@ url: https://github.com/larbish
4646
4747Now we can query authors:
4848
49- ` ` ` ts
49+ ` ` ` vue
50+ <script lang="ts" setup>
5051// Find a single author
51- const theAuthor = await queryCollection('authors')
52- .where('stem', '=', 'larbish')
53- .first()
52+ const { data : author } = await useAsyncData('larbish', () => {
53+ return queryCollection('authors')
54+ .where('stem', '=', 'larbish')
55+ .first()
56+ })
5457
5558// Get all authors
56- const authors = await queryCollection('authors')
57- .order('name', 'DESC')
58- .all()
59+ const { data : authors } = await useAsyncData('authors', () => {
60+ return queryCollection('authors')
61+ .order('name', 'DESC')
62+ .all()
63+ })
64+ </script>
5965```
You can’t perform that action at this time.
0 commit comments