2023-03-20 21:47:06 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2023-05-15 22:43:53 +00:00
|
|
|
<div v-if="count > 2">
|
|
|
|
count is above 2
|
|
|
|
</div>
|
|
|
|
<slot />
|
2023-03-20 21:47:06 +00:00
|
|
|
{{ data }}
|
|
|
|
<div id="long-async-component-count">
|
|
|
|
{{ count }}
|
|
|
|
</div>
|
2023-07-30 21:36:11 +00:00
|
|
|
{{ headers['custom-head'] }}
|
2023-11-09 17:01:13 +00:00
|
|
|
<slot
|
|
|
|
name="test"
|
|
|
|
:count="count"
|
|
|
|
/>
|
2023-03-20 21:47:06 +00:00
|
|
|
<p>hello world !!!</p>
|
2023-11-09 17:01:13 +00:00
|
|
|
<slot
|
|
|
|
v-for="(t, index) in 3"
|
|
|
|
name="hello"
|
|
|
|
:t="t"
|
|
|
|
>
|
2023-05-15 22:43:53 +00:00
|
|
|
<div :key="t">
|
|
|
|
fallback slot -- index: {{ index }}
|
|
|
|
</div>
|
|
|
|
</slot>
|
|
|
|
|
2023-11-09 17:01:13 +00:00
|
|
|
<slot
|
|
|
|
v-for="(t, index) in ['fall', 'back']"
|
|
|
|
name="fallback"
|
|
|
|
:t="t"
|
|
|
|
>
|
2023-05-15 22:43:53 +00:00
|
|
|
<div :key="t">
|
|
|
|
{{ t }} slot -- index: {{ index }}
|
|
|
|
</div>
|
2023-11-09 17:01:13 +00:00
|
|
|
<div
|
|
|
|
:key="t"
|
|
|
|
class="fallback-slot-content"
|
|
|
|
>
|
2023-05-15 22:43:53 +00:00
|
|
|
wonderful fallback
|
|
|
|
</div>
|
|
|
|
</slot>
|
2023-03-20 21:47:06 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2023-07-30 21:36:11 +00:00
|
|
|
import { getResponseHeaders } from 'h3'
|
2023-03-20 21:47:06 +00:00
|
|
|
defineProps<{
|
|
|
|
count: number
|
|
|
|
}>()
|
2023-07-30 21:36:11 +00:00
|
|
|
|
|
|
|
const evt = useRequestEvent()
|
|
|
|
const headers = getResponseHeaders(evt)
|
2023-03-20 21:47:06 +00:00
|
|
|
const { data } = await useFetch('/api/very-long-request')
|
|
|
|
</script>
|