only display the list when there are coaches found
This commit is contained in:
parent
25c054b514
commit
393a98e320
|
@ -7,11 +7,12 @@
|
||||||
<button>Refresh</button>
|
<button>Refresh</button>
|
||||||
<router-link to="/register">Register as Coach</router-link>
|
<router-link to="/register">Register as Coach</router-link>
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul v-if="hasCoaches">
|
||||||
<li v-for="coach in filteredCoaches" :key="coach.id">
|
<li v-for="coach in filteredCoaches" :key="coach.id">
|
||||||
{{ coach.firstName }}
|
{{ coach.firstName }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<h3 v-else>No coaches found.</h3>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -20,6 +21,9 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
filteredCoaches() {
|
filteredCoaches() {
|
||||||
return this.$store.getters['coaches/coaches'];
|
return this.$store.getters['coaches/coaches'];
|
||||||
|
},
|
||||||
|
hasCoaches() {
|
||||||
|
return this.$store.getters['coaches/hasCoaches'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Reference in New Issue