Watch updats in home component
This commit is contained in:
		| @@ -38,7 +38,7 @@ | ||||
| </template> | ||||
|  | ||||
| <script lang="ts"> | ||||
| import { Component, Vue } from 'vue-property-decorator'; | ||||
| import { Component, Vue, Watch } from 'vue-property-decorator'; | ||||
| import axios from 'axios'; | ||||
|  | ||||
| type TotalStatsHeaders = | ||||
| @@ -57,6 +57,7 @@ interface TotalStatsResult { | ||||
| export default class Home extends Vue { | ||||
|   totalStats?: TotalStatsResult[]; | ||||
|  | ||||
|   @Watch('totalStats') | ||||
|   getStat(key: TotalStatsHeaders): string | undefined { | ||||
|     const result = this.totalStats?.find((elem) => elem.name === key); | ||||
|     if (result) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user