I use Vue and have a method in load.js.
async function loadTask(x) {
return await x; // Some async code
}
export { loadTask };
In a Vue component I call it but the await prevent the <template> to load. Without the await, the code below runs. What do I miss?
<script setup>
import { loadTask } from './methods/load.js';
const test = loadTask(3);
console.log(await test);
</script>
<template>
<div>Does not run</div>
</template>