-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
{ | ||
"prettier.enable": false, | ||
"editor.formatOnSave": false, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint", | ||
"files.associations": { | ||
"*.css": "tailwindcss" | ||
}, | ||
"editor.quickSuggestions": { | ||
"strings": true | ||
}, | ||
"[vue]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,27 @@ | ||
import { VueQueryPlugin } from '@tanstack/vue-query' | ||
import type { DehydratedState, VueQueryPluginOptions } from '@tanstack/vue-query' | ||
import { QueryClient, VueQueryPlugin, dehydrate, hydrate } from '@tanstack/vue-query' | ||
import { useState } from '#app' | ||
|
||
export default defineNuxtPlugin((nuxtApp) => { | ||
nuxtApp.vueApp.use(VueQueryPlugin) | ||
export default defineNuxtPlugin((nuxt) => { | ||
const vueQueryState = useState<DehydratedState | null>('vue-query') | ||
|
||
// Modify your Vue Query global settings here | ||
const queryClient = new QueryClient({ | ||
defaultOptions: { queries: { staleTime: 5000 } }, | ||
}) | ||
const options: VueQueryPluginOptions = { queryClient } | ||
|
||
nuxt.vueApp.use(VueQueryPlugin, options) | ||
|
||
if (process.server) { | ||
nuxt.hooks.hook('app:rendered', () => { | ||
vueQueryState.value = dehydrate(queryClient) | ||
}) | ||
} | ||
|
||
if (process.client) { | ||
nuxt.hooks.hook('app:created', () => { | ||
hydrate(queryClient, vueQueryState.value) | ||
}) | ||
} | ||
}) |
fe503aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for morpheme-nuxt-starter ready!
✅ Preview
https://morpheme-nuxt-starter-c7nucrjl6-gravitano.vercel.app
Built with commit fe503aa.
This pull request is being automatically deployed with vercel-action