Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

app.vue

31 lines841 Bytes

1<script setup lang="ts">
2import { VueQueryDevtools } from '@tanstack/vue-query-devtools'
3import ApproachTabs from './components/ApproachTabs.vue'
4​
5useHead({
6 title: 'TanStack Query — Optimistic Updates',
7 meta: [
8 {
9 name: 'description',
10 content: 'Nuxt example with optimistic updates',
11 },
12 ],
13})
14</script>
15​
16<template>
17 <main style="max-width: 600px; margin: 0 auto; padding: 2rem 1rem">
18 <h1>Optimistic Updates with TanStack Query</h1>
19 <p style="color: #666; margin-bottom: 1.5rem">
20 Add todos to see optimistic updates in action. The server randomly fails
21 ~30% of the time so you can observe automatic rollback.
22 </p>
23 <Suspense>
24 <ApproachTabs />
25 <template #fallback>
26 <p>Loading todos…</p>
27 </template>
28 </Suspense>
29 </main>
30 <VueQueryDevtools />
31</template>