feat: onMounted get data
This commit is contained in:
parent
08d252954e
commit
f0e4f34206
@ -8,6 +8,7 @@ import {
|
|||||||
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
|
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
|
||||||
import DonutChart from '@/components/charts/DonutChart.vue';
|
import DonutChart from '@/components/charts/DonutChart.vue';
|
||||||
import { computed, ref } from '@vue/reactivity';
|
import { computed, ref } from '@vue/reactivity';
|
||||||
|
import { onMounted } from 'vue';
|
||||||
import { Icon } from '@iconify/vue';
|
import { Icon } from '@iconify/vue';
|
||||||
import 'vue-json-pretty/lib/styles.css';
|
import 'vue-json-pretty/lib/styles.css';
|
||||||
import type {
|
import type {
|
||||||
@ -33,7 +34,9 @@ const balances = ref([] as Coin[]);
|
|||||||
const unbonding = ref([] as UnbondingResponses[]);
|
const unbonding = ref([] as UnbondingResponses[]);
|
||||||
const unbondingTotal = ref(0);
|
const unbondingTotal = ref(0);
|
||||||
const chart = {};
|
const chart = {};
|
||||||
|
onMounted(() => {
|
||||||
|
loadAccount(props.address);
|
||||||
|
});
|
||||||
const totalAmountByCategory = computed(() => {
|
const totalAmountByCategory = computed(() => {
|
||||||
let sumDel = 0;
|
let sumDel = 0;
|
||||||
delegations.value?.forEach((x) => {
|
delegations.value?.forEach((x) => {
|
||||||
@ -88,7 +91,6 @@ function loadAccount(address: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function updateEvent() {
|
function updateEvent() {
|
||||||
loadAccount(props.address);
|
loadAccount(props.address);
|
||||||
}
|
}
|
||||||
@ -141,9 +143,13 @@ function updateEvent() {
|
|||||||
for="transfer"
|
for="transfer"
|
||||||
class="btn btn-primary btn-sm"
|
class="btn btn-primary btn-sm"
|
||||||
@click="
|
@click="
|
||||||
dialog.open('transfer', {
|
dialog.open(
|
||||||
chain_name: blockchain.current?.prettyName,
|
'transfer',
|
||||||
}, updateEvent)
|
{
|
||||||
|
chain_name: blockchain.current?.prettyName,
|
||||||
|
},
|
||||||
|
updateEvent
|
||||||
|
)
|
||||||
"
|
"
|
||||||
>transfer</label
|
>transfer</label
|
||||||
>
|
>
|
||||||
@ -355,9 +361,13 @@ function updateEvent() {
|
|||||||
for="delegate"
|
for="delegate"
|
||||||
class="btn btn-primary btn-xs mr-2"
|
class="btn btn-primary btn-xs mr-2"
|
||||||
@click="
|
@click="
|
||||||
dialog.open('delegate', {
|
dialog.open(
|
||||||
validator_address: v.delegation.validator_address,
|
'delegate',
|
||||||
}, updateEvent)
|
{
|
||||||
|
validator_address: v.delegation.validator_address,
|
||||||
|
},
|
||||||
|
updateEvent
|
||||||
|
)
|
||||||
"
|
"
|
||||||
>delegate</label
|
>delegate</label
|
||||||
>
|
>
|
||||||
@ -365,9 +375,13 @@ function updateEvent() {
|
|||||||
for="redelegate"
|
for="redelegate"
|
||||||
class="btn btn-primary btn-xs mr-2"
|
class="btn btn-primary btn-xs mr-2"
|
||||||
@click="
|
@click="
|
||||||
dialog.open('redelegate', {
|
dialog.open(
|
||||||
validator_address: v.delegation.validator_address,
|
'redelegate',
|
||||||
}, updateEvent)
|
{
|
||||||
|
validator_address: v.delegation.validator_address,
|
||||||
|
},
|
||||||
|
updateEvent
|
||||||
|
)
|
||||||
"
|
"
|
||||||
>Redelegate</label
|
>Redelegate</label
|
||||||
>
|
>
|
||||||
@ -375,9 +389,13 @@ function updateEvent() {
|
|||||||
for="unbond"
|
for="unbond"
|
||||||
class="btn btn-primary btn-xs"
|
class="btn btn-primary btn-xs"
|
||||||
@click="
|
@click="
|
||||||
dialog.open('unbond', {
|
dialog.open(
|
||||||
validator_address: v.delegation.validator_address,
|
'unbond',
|
||||||
}, updateEvent)
|
{
|
||||||
|
validator_address: v.delegation.validator_address,
|
||||||
|
},
|
||||||
|
updateEvent
|
||||||
|
)
|
||||||
"
|
"
|
||||||
>Unbond</label
|
>Unbond</label
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user