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

@@ -28,13 +28,17 @@
</template>
<script setup lang="ts">
import { getLocale } from "~/utils/locale"
useHead({
title: "Products",
})
const { t } = useI18n()
const { data: products } = await useAsyncData("products", () => queryContent("/products").find())
const { data: products } = await useAsyncData("products", () => {
return queryContent("/products").where({ _locale: getLocale() }).find()
})
</script>
<style scoped>