mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
Discard changes to playground/app.vue
This commit is contained in:
parent
6136b3e219
commit
dd91a038ef
@ -1,31 +1,13 @@
|
||||
<script setup>
|
||||
const page = ref(0)
|
||||
const nuxt = useNuxtApp()
|
||||
const { data, refresh } = await useFetch('https://icanhazdadjoke.com/', {
|
||||
query: { page }, // "fed" into watch array for asyncData under the hood
|
||||
getCachedData: (key) => {
|
||||
return nuxt.payload.data[key] || nuxt.static.data[key]
|
||||
},
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
},
|
||||
})
|
||||
<script setup lang="ts">
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Edit this file to play around with Nuxt but never commit changes! -->
|
||||
<div>
|
||||
<button @click="refresh()">
|
||||
New Joke (refresh, default)
|
||||
</button>
|
||||
<button @click="refresh({ force: true })">
|
||||
New Joke (refresh, force)
|
||||
</button>
|
||||
<button @click="page++">
|
||||
New Joke (update query value + 1)
|
||||
</button>
|
||||
<button @click="page--">
|
||||
New Joke (update query value - 1)
|
||||
</button>
|
||||
{{ data.joke }}
|
||||
Nuxt 3 Playground
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user