From 5ecba3b28370c8a79e495bc8f66a2c193f39035b Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Tue, 26 Dec 2023 21:04:32 +0800 Subject: [PATCH] support metadata --- src/components/ProposalListItem.vue | 19 ++++++++++++------- src/modules/[chain]/gov/[proposal_id].vue | 12 ++++++++---- src/types/gov.ts | 1 + 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/components/ProposalListItem.vue b/src/components/ProposalListItem.vue index 7ee0ce59..98b52106 100644 --- a/src/components/ProposalListItem.vue +++ b/src/components/ProposalListItem.vue @@ -9,7 +9,7 @@ import { select } from '@/components/dynamic/index'; import type { PaginatedProposals } from '@/types'; import ProposalProcess from './ProposalProcess.vue'; import type { PropType } from 'vue'; -import { ref } from 'vue'; +import { computed, ref } from 'vue'; const dialog = useTxDialog(); defineProps({ proposals: { type: Object as PropType }, @@ -38,6 +38,11 @@ const voterStatusMap: Record = { }; const proposalInfo = ref(); + +function metaItem(metadata: string|undefined): { title: string; summary: string } { + return metadata ? JSON.parse(metadata) : {} +} +