Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ContentQuery): generate cache key based on props #1174

Merged
merged 1 commit into from May 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/runtime/components/ContentQuery.ts
@@ -1,3 +1,4 @@
import { hash } from 'ohash'
import { PropType, toRefs, defineComponent, h, useSlots } from 'vue'
import type { ParsedContent, QueryBuilder, SortParams } from '../types'
import { computed, useAsyncData, queryContent } from '#imports'
Expand Down Expand Up @@ -98,7 +99,7 @@ export default defineComponent({
const isPartial = computed(() => path.value.includes('/_'))

const { data, refresh } = await useAsyncData<ParsedContent | ParsedContent[]>(
`content-doc-${path.value}`,
`content-query-${hash(props)}`,
() => {
let queryBuilder: QueryBuilder

Expand Down