Nuxt content tool chain

This commit is contained in:
2024-08-13 22:44:36 +08:00
parent 653ade9acc
commit 950ee1f489
11 changed files with 70 additions and 17 deletions

View File

@@ -42,9 +42,13 @@
</template>
<script setup lang="ts">
import { getLocale } from "~/utils/locale"
const { t } = useI18n()
const { data: products } = await useAsyncData("products", () => queryContent("/products").where({ archived: { $ne: true } }).limit(5).find())
const { data: products } = await useAsyncData("products", () => {
return queryContent("/products").where({ _locale: getLocale(), archived: { $ne: true } }).limit(5).find()
})
</script>
<style scoped>