diff --git a/src/types/block.d.ts b/src/types/block.d.ts index 66431f1..c29dfc4 100644 --- a/src/types/block.d.ts +++ b/src/types/block.d.ts @@ -3,3 +3,13 @@ export declare type AssetType = { exec: string symbol: string } + +export declare type BlockOverview = { + height: number + hash: string + txCount: number + txHash: string + parentHash: string + blockTime: number + stateHash: string +} diff --git a/src/utils/filters.ts b/src/utils/filters.ts index 5bcae81..06a2ec0 100644 --- a/src/utils/filters.ts +++ b/src/utils/filters.ts @@ -3,6 +3,9 @@ import store from '@/store' export const filterHash = (str: string, num?: number): string => { const length = num || 16 + if (!str) { + return '' + } return str.substr(0, length) + '...' + str.substr(-4) } diff --git a/src/views/Block/detail.vue b/src/views/Block/detail.vue index 52f3f10..0d97b13 100644 --- a/src/views/Block/detail.vue +++ b/src/views/Block/detail.vue @@ -28,7 +28,14 @@
- {{ (info.height - 1) > 0 ? info.height - 1 : '无' }} + + + {{ info.height - 1 }} + + + + 无 +
@@ -45,15 +52,22 @@
- {{ (info.height + 1) > maxHeight ? '无' : (info.height + 1) }} + + + {{ next.height }} + + + + 无 +
@@ -99,36 +113,64 @@