I am trying to use <suspense> multiple times as a fallback while i am refreshing a component's data (using import() on a json file from the async setup()).
As stated by the documentation:
Once in a resolved state, will only revert to a pending state if the root node of the #default slot is replaced.
What's the best way to proc a new pending state of the suspense node from code and call the setup() function again? How am i supposed to replace the root node of the #default slot?
For the moment i force the replacement of the component with a :is statement switching it from a dummy value with a setTimeout delay:
function childComponentHaveToBeRefreshed{
cType.value = markRaw(dummyUI);
//have to set a 1ms timeout there otherwise the replacement seems ignored
setTimeout(()=>{ cType.value = markRaw(realUI); },1);
};
<Suspense>
<component :is="cType"></component>
<template #fallback>
<Loading></Loading>
</template>
</Suspense>