From 78198627c7eb9317a783f0ab62692fb1b1d16372 Mon Sep 17 00:00:00 2001 From: ymmooot Date: Thu, 28 Nov 2024 16:05:55 +0900 Subject: [PATCH] docs: add description about tagPosition --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fe1ab65f..0f7dc028 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ export default defineNuxtConfig({ ### Composition API You can call `useJsonld` with a json object. -Alternatively, you can pass a function for a reactive json, just as [`useHead`](https://v3.nuxtjs.org/guide/features/head-management/#usehead-composable) composable. +Alternatively, you can pass a function for a reactive json. You can use `useJsonld` without importing, since it is provided as [Nuxt auto-imports functions](https://v3.nuxtjs.org/guide/concepts/auto-imports#nuxt-auto-imports). Of course, you can import explicitly from `#jsonld`. @@ -60,6 +60,26 @@ useJsonld(() => ({ ``` +#### tagPosition + +You can use the `tagPosition: 'bodyClose'` option on applicable tags to append them to the end of the `` tag. +This option works the same as the one described in [useHead](https://nuxt.com/docs/getting-started/seo-meta#body-tags). + +default: `head` + +```ts +useJsonld( + { + '@context': 'https://schema.org', + '@type': 'Thing', + name: 'static json', + }, + { + tagPosition: 'bodyClose', // 'head', 'bodyOpen', 'bodyClose' + } +); +``` + ### Options API Make a jsonld method to your Vue components and return structured data object.