Skip to content

Commit afc782f

Browse files
committed
chore: add devtools to vue2 example, add more queries
1 parent b38941b commit afc782f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

examples/basic-vue-2.x/src/App.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script lang="ts">
22
import { defineComponent } from "@vue/composition-api";
3+
import { Component } from "vue";
34
import { useQuery } from "vue-query";
5+
import { VueQueryDevTools } from "vue-query/devtools";
46
57
interface Todo {
68
userId: number;
@@ -15,11 +17,14 @@ const todoFetcher = async (): Promise<Todo[]> =>
1517
);
1618
1719
export default defineComponent({
20+
components: { VueQueryDevTools: VueQueryDevTools as Component },
1821
setup() {
1922
const { isLoading, isError, isFetching, data, error, refetch } = useQuery(
2023
"todos",
2124
todoFetcher
2225
);
26+
useQuery("todos2", todoFetcher);
27+
useQuery("todos3", todoFetcher);
2328
2429
return { isLoading, isError, isFetching, data, error, refetch };
2530
},
@@ -44,6 +49,7 @@ export default defineComponent({
4449
</ul>
4550
</div>
4651
<div v-else>Nothing to see here...</div>
52+
<VueQueryDevTools :initialIsOpen="true" />
4753
</div>
4854
</template>
4955

examples/basic/src/App.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export default defineComponent({
2323
"todos",
2424
todoFetcher
2525
);
26+
useQuery("todos2", todoFetcher);
27+
useQuery("todos3", todoFetcher);
2628
2729
return { isLoading, isError, isFetching, data, error, refetch };
2830
},

examples/multi-page/src/Page.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export default defineComponent({
3030
cacheTime: 4000,
3131
}
3232
);
33+
useQuery("todos2", todoFetcher);
34+
useQuery("todos3", todoFetcher);
3335
3436
return { isLoading, isError, isFetching, data, error, refetch };
3537
},

0 commit comments

Comments
 (0)