diff --git a/.vscode/settings.json b/.vscode/settings.json index a36d617..502bb4f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" } } \ No newline at end of file diff --git a/pages/products.vue b/pages/products.vue index d690feb..502ad70 100644 --- a/pages/products.vue +++ b/pages/products.vue @@ -3,12 +3,16 @@ import { useQuery } from '@tanstack/vue-query' const url = 'https://dummyjson.com/products' -const { isLoading, isError, data, error } = useQuery({ +const { isLoading, isError, data, error, suspense } = useQuery({ queryKey: ['products'], queryFn: () => { return fetch(url).then(res => res.json()) }, }) + +onServerPrefetch(async () => { + await suspense() +})