2023-08-24 12:06:29 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div>immediate-remove-unmounted.vue</div>
|
|
|
|
<div id="immediate-data">
|
2024-05-21 22:58:38 +00:00
|
|
|
{{ data === null ? "null" : (data === undefined ? 'undefined' : data) }}
|
2023-08-24 12:06:29 +00:00
|
|
|
</div>
|
2023-11-09 17:01:13 +00:00
|
|
|
<button
|
|
|
|
id="execute-btn"
|
|
|
|
@click="execute"
|
|
|
|
>
|
2023-08-24 12:06:29 +00:00
|
|
|
execute
|
|
|
|
</button>
|
2023-11-09 17:01:13 +00:00
|
|
|
<NuxtLink
|
|
|
|
id="to-index"
|
|
|
|
to="/"
|
|
|
|
>
|
2023-08-24 12:06:29 +00:00
|
|
|
index
|
|
|
|
</NuxtLink>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
const { data, execute } = await useAsyncData('immediateFalse', () => $fetch('/api/random'), { immediate: false })
|
|
|
|
|
2024-06-19 17:04:40 +00:00
|
|
|
if (data.value !== undefined) {
|
|
|
|
throw new Error(`Initial data should be undefined: ` + data.value)
|
2023-08-24 12:06:29 +00:00
|
|
|
}
|
|
|
|
</script>
|