mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-05 11:57:13 +00:00
38 lines
855 B
Vue
38 lines
855 B
Vue
|
<script setup lang="ts">
|
||
|
import { useSharedAsyncData } from '../../composables/asyncDataTests'
|
||
|
import ComponentWithSharedUseAsyncData from '../../components/ComponentWithSharedUseAsyncData.vue'
|
||
|
|
||
|
const { data, pending, execute } = useSharedAsyncData()
|
||
|
const router = useRouter()
|
||
|
|
||
|
const page = ref(1)
|
||
|
const changeQuery = () => {
|
||
|
page.value += 1
|
||
|
router.push({
|
||
|
query: {
|
||
|
page: page.value
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<div>
|
||
|
<div id="pageWithSharedAsyncData__execute" @click="() => execute()">
|
||
|
execute
|
||
|
</div>
|
||
|
<div id="pageWithSharedAsyncData__changeQuery" @click="changeQuery">
|
||
|
changeQuery
|
||
|
</div>
|
||
|
|
||
|
<div id="pageWithSharedAsyncData__data">
|
||
|
{{ data }}
|
||
|
</div>
|
||
|
<div id="pageWithSharedAsyncData__pending">
|
||
|
{{ pending }}
|
||
|
</div>
|
||
|
|
||
|
<ComponentWithSharedUseAsyncData />
|
||
|
</div>
|
||
|
</template>
|