Watch updats in home component
This commit is contained in:
parent
b1785f419a
commit
4c55f6571a
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user