Add ready property to home
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <div class="home"> | ||||
|     <b-container v-if="totalStats"> | ||||
|     <b-container v-if="ready"> | ||||
|       <b-row> | ||||
|         <b-col class="total-title"> | ||||
|           <h2>Total login attempts</h2> | ||||
| @@ -57,6 +57,8 @@ interface TotalStatsResult { | ||||
| export default class Home extends Vue { | ||||
|   totalStats?: TotalStatsResult[]; | ||||
|  | ||||
|   ready = false; | ||||
|  | ||||
|   @Watch('totalStats', { immediate: true, deep: true }) | ||||
|   getStat(key: TotalStatsHeaders): string | undefined { | ||||
|     const result = this.totalStats?.find((elem) => elem.name === key); | ||||
| @@ -72,6 +74,7 @@ export default class Home extends Vue { | ||||
|       .get<TotalStatsResult[]>(url) | ||||
|       .then((resp) => { | ||||
|         this.totalStats = resp.data; | ||||
|         this.ready = true; | ||||
|         console.log(this.totalStats); | ||||
|       }) | ||||
|       .catch((e) => { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user