Skip to content

Commit

Permalink
refactor: convert bpvotes component to script setup format
Browse files Browse the repository at this point in the history
  • Loading branch information
donnyquixotic committed Nov 24, 2023
1 parent 0bb72ea commit 1c2821c
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/components/BpVotes.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<script>
<script setup lang="ts">
import { ref, defineProps, onMounted } from 'vue';
import { getHyperionAccountData } from 'src/api/hyperion';
export default {
props: {
account: {
type: String,
required: true,
},
const props = defineProps({
account: {
type: String,
required: true,
},
data() {
return {
bpVotes: [],
};
},
async mounted() {
});
const bpVotes = ref([]);
onMounted(async () => {
try {
const {
account: {
voter_info: { producers },
},
} = await getHyperionAccountData(this.account);
this.bpVotes = producers;
},
};
} = await getHyperionAccountData(props.account);
bpVotes.value = producers;
} catch(e) {
console.error(e);
}
});
</script>

<template>
Expand Down Expand Up @@ -68,7 +68,6 @@ export default {
}
.vote-fraction-wrap {
// color: var(--q-primary);
display: flex;
justify-content: center;
align-items: center;
Expand Down

0 comments on commit 1c2821c

Please sign in to comment.