2023-08-24 12:06:29 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div>immediate-remove-unmounted.vue</div>
|
|
|
|
<div id="immediate-data">
|
|
|
|
{{ data === null ? "null" : data }}
|
|
|
|
</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 })
|
|
|
|
|
|
|
|
if (data.value !== null) {
|
|
|
|
throw new Error('Initial data should be null: ' + data.value)
|
|
|
|
}
|
|
|
|
</script>
|