v1.0.0
1.0.0 (2022-02-17)
Features
π Migration
v1 of @nuxtjs/sanity requires either Nuxt Bridge or Nuxt 3. (If you are using Nuxt 2 without Bridge, you should continue to use v0.10.)
-
The main change between Nuxt 2 -> Nuxt 3 is that there is no longer a globally available
$sanityhelper. If you want to keep the current behaviour, just enable theglobalHelperoption:import { defineNuxtConfig } from 'nuxt3' export default defineNuxtConfig({ modules: ['@nuxtjs/sanity'] sanity: { + globalHelper: true } }) -
Instead of adding
@nuxtjs/sanity/moduleyou will add@nuxtjs/sanityin yournuxt.configimport { defineNuxtConfig } from 'nuxt3' export default defineNuxtConfig({ - modules: ['@nuxtjs/sanity/module'] + modules: ['@nuxtjs/sanity'] }) -
You should no longer import helpers like
groqdirectly from@nuxtjs/sanity. These will be available automatically throughout your app using the Nuxt auto-imports feature. If you do need to import them directly you can do so by importing from#imports.import { groq, useSanity, useSanityQuery } from '#imports'
-
If you are using
<SanityContent>this now no longer renders a wrapper container. If you need the wrapper, you can add it yourself.<template> - <SanityContent :blocks="blocks" /> + <div> + <SanityContent :blocks="blocks" /> + </div> </template>