My Vue.js 2.x component fetches data from the server in this way.
<template>
...
<a href="..." v-if="data.status !== 'blind'">Link</a>
...
</template>
<script>
export default {
...
data: {
return() {
data: {}
}
};
...
async created() {
const loadedData = await this.$axios.get(`server-url`);
this.data = loadedData.data;
}
</script>
Although I use await
, there is a delay in rendering the anchor tag when data.status
is 'blind'. Is there a way to render v-if
only after the axios data has been loaded?