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