Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb866ef commit 26d7197Copy full SHA for 26d7197
docs/content/docs/3.files/2.yaml.md
@@ -46,14 +46,20 @@ url: https://github.com/larbish
46
47
Now we can query authors:
48
49
-```ts
+```vue
50
+<script lang="ts" setup>
51
// Find a single author
-const theAuthor = await queryCollection('authors')
52
- .where('stem', '=', 'larbish')
53
- .first()
+const { data: author } = await useAsyncData('larbish', () => {
+ return queryCollection('authors')
54
+ .where('stem', '=', 'larbish')
55
+ .first()
56
+})
57
58
// Get all authors
-const authors = await queryCollection('authors')
- .order('name', 'DESC')
- .all()
59
+const { data: authors } = await useAsyncData('authors', () => {
60
61
+ .order('name', 'DESC')
62
+ .all()
63
64
+</script>
65
```
0 commit comments