0👍
✅
Please note, you have an error in your if
condition. It should be:
v-if="data.status !== 'blind'"
Anyway, in my opinion the best way to handle ajax calls is to use a flag. Something like this:
<template>
...
<a href="..." v-if="!loading && data.status !== 'blind'">Link</a>
...
</template>
<script>
export default {
...
data: {
return() {
loading: false,
data: {}
}
};
...
async created() {
this.loading = true;
const loadedData = await this.$axios.get(`server-url`);
this.loading = false;
this.data = loadedData.data;
}
</script>
Source:stackexchange.com