forked from LaconicNetwork/cosmos-explorer
improve validator and proposal
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<script lang="ts" setup>
|
||||
import { useFormatter } from '@/stores';
|
||||
import type { Coin } from '@/types';
|
||||
|
||||
const props = defineProps({
|
||||
value: { type: Array<Coin>},
|
||||
})
|
||||
|
||||
const format = useFormatter()
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
{{ format.formatTokens(value, true, "0,0.[000000]") }}
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ArrayCoinElement'
|
||||
}
|
||||
</script>
|
||||
@@ -7,6 +7,7 @@ import {select} from './index'
|
||||
import ArrayBytesElement from './ArrayBytesElement.vue';
|
||||
import ArrayObjectElement from './ArrayObjectElement.vue';
|
||||
import TextElement from './TextElement.vue';
|
||||
import ArrayCoinElement from './ArrayCoinElement.vue';
|
||||
|
||||
const props = defineProps({
|
||||
value: { type: Array<Object>},
|
||||
@@ -18,6 +19,8 @@ function selectByElement() {
|
||||
switch(true) {
|
||||
case first instanceof Uint8Array:
|
||||
return ArrayBytesElement
|
||||
case Object.keys(first).includes('denom'):
|
||||
return ArrayCoinElement
|
||||
default:
|
||||
return ArrayObjectElement
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import TextElement from './TextElement.vue'
|
||||
import ObjectElement from './ObjectElement.vue'
|
||||
import { select } from './index'
|
||||
|
||||
const props = defineProps(["value", "direct"]);
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
<script lang="ts" setup>
|
||||
import { useFormatter } from '@/stores';
|
||||
import MdEditor from 'md-editor-v3';
|
||||
|
||||
const props = defineProps(["value"]);
|
||||
const format = useFormatter()
|
||||
function isMD() {
|
||||
if(props.value && (props.value.indexOf("\n") > -1 || props.value.indexOf("\\n") > -1)){
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<span>{{ props.value }}</span>
|
||||
<template>
|
||||
<MdEditor v-if="isMD()" :model-value="format.multiLine(value)" previewOnly></MdEditor>
|
||||
<span v-else>{{ value }}</span>
|
||||
</template>
|
||||
Reference in New Issue
Block a user