Can an early return be implemented in the Vue setup script?
<template>
<div v-if="error || !data">Fallback content...</div>
<div v-else>Page content...</div>
</template>
<script setup lang="ts">
// ...
const { data, error } = await fetchApi()
// Is there a way to implement an early return here? For example, something like 'if (error || !data) return'?
// ...
// There is a lot of code that might not need to run if there is an error.
// For instance, calculating variables used only in the page content.
// ...
</script>
Note: I am transitioning from React to Vue and still learning how things work in Vue.