mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 10:04:05 +00:00
20 lines
547 B
Vue
20 lines
547 B
Vue
<script setup lang="ts">
|
|
if (import.meta.client) {
|
|
console.log('[sync] [async]')
|
|
}
|
|
const route = useRoute('suspense-async-parent-sync-child')
|
|
await new Promise(resolve => setTimeout(resolve, 50))
|
|
if (import.meta.client) {
|
|
console.log(`[sync] [${route.params.parent}] [async] [${route.params.child}] running async data`)
|
|
}
|
|
const data = route.params
|
|
</script>
|
|
|
|
<template>
|
|
<div :id="'child' + route.path.replace(/[/-]+/g, '-')">
|
|
Async child: {{ route.params.parent }} - {{ route.params.child }}
|
|
<hr>
|
|
{{ data }}
|
|
</div>
|
|
</template>
|