2021-09-30 18:19:55 +00:00
|
|
|
<script setup>
|
2022-03-28 17:12:41 +00:00
|
|
|
const showMountain = ref(false)
|
|
|
|
|
|
|
|
const refreshing = ref(false)
|
|
|
|
const refreshAll = async () => {
|
|
|
|
refreshing.value = true
|
|
|
|
try {
|
|
|
|
await refreshNuxtData()
|
|
|
|
} finally {
|
|
|
|
refreshing.value = false
|
|
|
|
}
|
|
|
|
}
|
2021-04-23 20:30:43 +00:00
|
|
|
</script>
|
2021-12-23 19:27:08 +00:00
|
|
|
|
|
|
|
<template>
|
2022-03-31 13:31:04 +00:00
|
|
|
<NuxtExampleLayout example="composables/use-async-data">
|
2021-12-23 19:27:08 +00:00
|
|
|
<div>
|
2022-03-28 17:12:41 +00:00
|
|
|
<div class="flex justify-center gap-2">
|
|
|
|
<NButton @click="showMountain = !showMountain">
|
|
|
|
{{ showMountain ? 'Hide' : 'Show' }} Mountain
|
|
|
|
</NButton>
|
|
|
|
<NButton :disabled="refreshing" @click="refreshAll">
|
|
|
|
Refetch All Data
|
|
|
|
</NButton>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="flex justify-center gap-2">
|
|
|
|
<CounterExample />
|
|
|
|
</div>
|
|
|
|
<div class="flex justify-center gap-2">
|
|
|
|
<MountainExample v-if="showMountain" />
|
|
|
|
</div>
|
2021-12-23 19:27:08 +00:00
|
|
|
</div>
|
|
|
|
</NuxtExampleLayout>
|
|
|
|
</template>
|