-
notice that the example about <div v-if="asyncStatus === 'loading'">
Loading...
</div>
<div v-else-if="state.status === 'error'">
Oops, an error happened...
</div>
<div v-else-if="state.data">
<TodoItem v-for="todo in state.data" :key="todo.id" :todo="todo" />
</div>
After go back to I wonder the reason of use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It depends on the example, sometimes you want to show you are refreshing the data. In this one, since it's |
Beta Was this translation helpful? Give feedback.
It depends on the example, sometimes you want to show you are refreshing the data. In this one, since it's
v-else-if="state.status == 'error'"
instead ofv-if
, yes, usingisPending
is indeed a better default and the docs should be updated