Skip to content

Commit

Permalink
docs: use nuxt import.meta.* properties (#7185)
Browse files Browse the repository at this point in the history
* fix: opt in to `import.meta.*` properties

* Update ssr.md
  • Loading branch information
danielroe committed Mar 28, 2024
1 parent 21bde49 commit eaf4af6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/framework/vue/guides/ssr.md
Expand Up @@ -36,13 +36,13 @@ export default defineNuxtPlugin((nuxt) => {

nuxt.vueApp.use(VueQueryPlugin, options)

if (process.server) {
if (import.meta.server) {
nuxt.hooks.hook('app:rendered', () => {
vueQueryState.value = dehydrate(queryClient)
})
}

if (process.client) {
if (import.meta.client) {
hydrate(queryClient, vueQueryState.value)
}
})
Expand Down
4 changes: 2 additions & 2 deletions examples/vue/nuxt3/plugins/vue-query.ts
Expand Up @@ -22,13 +22,13 @@ export default defineNuxtPlugin((nuxt) => {

nuxt.vueApp.use(VueQueryPlugin, options)

if (process.server) {
if (import.meta.server) {
nuxt.hooks.hook('app:rendered', () => {
vueQueryState.value = dehydrate(queryClient)
})
}

if (process.client) {
if (import.meta.client) {
nuxt.hooks.hook('app:created', () => {
hydrate(queryClient, vueQueryState.value)
})
Expand Down

0 comments on commit eaf4af6

Please sign in to comment.