forked from cerc-io/cosmos-explorer
Parameters Mobile
This commit is contained in:
parent
881e64b3ff
commit
a0104d5fee
@ -1,22 +1,29 @@
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from 'vue';
|
||||
const props = defineProps({
|
||||
cardItem: {
|
||||
type: Object as PropType<{title: string;items: Array<any>;}>,
|
||||
},
|
||||
})
|
||||
|
||||
cardItem: {
|
||||
type: Object as PropType<{ title: string; items: Array<any> }>,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="bg-card px-4 pt-3 pb-4 rounded mt-6"
|
||||
v-if="props.cardItem?.items && props.cardItem?.items?.length > 0">
|
||||
<div class="text-base mb-3 text-main">{{ props.cardItem?.title }}</div>
|
||||
<div class="grid grid-cols-5 gap-4">
|
||||
<div v-for="(item,index) of props.cardItem?.items" :key="index" class="rounded-sm bg-active px-4 py-2">
|
||||
<div class="text-xs mb-2 text-secondary">{{ item?.subtitle }}</div>
|
||||
<div class="text-base text-main">{{ item?.value }}</div>
|
||||
<!-- {{ item }} -->
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="bg-card px-4 pt-3 pb-4 rounded mt-6"
|
||||
v-if="props.cardItem?.items && props.cardItem?.items?.length > 0"
|
||||
>
|
||||
<div class="text-base mb-3 text-main">{{ props.cardItem?.title }}</div>
|
||||
<div
|
||||
class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 2xl:grid-cols-6 gap-4"
|
||||
>
|
||||
<div
|
||||
v-for="(item, index) of props.cardItem?.items"
|
||||
:key="index"
|
||||
class="rounded-sm bg-active px-4 py-2"
|
||||
>
|
||||
<div class="text-xs mb-2 text-secondary">{{ item?.subtitle }}</div>
|
||||
<div class="text-base text-main">{{ item?.value }}</div>
|
||||
<!-- {{ item }} -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -1,26 +1,29 @@
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from 'vue';
|
||||
const props = defineProps({
|
||||
tableItem: {
|
||||
type: Object as PropType<{title: string;items: Object;}>,
|
||||
},
|
||||
})
|
||||
tableItem: {
|
||||
type: Object as PropType<{ title: string; items: Object }>,
|
||||
},
|
||||
});
|
||||
|
||||
function formatTitle (name: string){
|
||||
return String(name).replaceAll('_', ' ')
|
||||
function formatTitle(name: string) {
|
||||
return String(name).replaceAll('_', ' ');
|
||||
}
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="bg-card px-4 pt-3 pb-4 rounded mt-6">
|
||||
<div class="text-base mb-3 text-main">{{ props.tableItem?.title }}</div>
|
||||
<div class="">
|
||||
<div class="d-flex flex-nowrap" v-for="(item,index ) of props.tableItem?.items" :key="index">
|
||||
<div class="mr-6">{{ formatTitle(item?.subtitle) }}</div>
|
||||
<div class="flex-1" >{{ item?.value }}</div>
|
||||
<div>{{typeof(item?.value )}}</div>
|
||||
<!-- {{ item }} -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-card px-4 pt-3 pb-4 rounded mt-6">
|
||||
<div class="text-base mb-3 text-main">{{ props.tableItem?.title }}</div>
|
||||
<div class="">
|
||||
<div
|
||||
class="flex flex-nowrap"
|
||||
v-for="(item, index) of props.tableItem?.items"
|
||||
:key="index"
|
||||
>
|
||||
<div class="mr-6">{{ formatTitle(item?.subtitle) }}</div>
|
||||
<div class="flex-1">{{ item?.value }}</div>
|
||||
<div>{{ typeof item?.value }}</div>
|
||||
<!-- {{ item }} -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -1,50 +1,55 @@
|
||||
<script lang="ts" setup>
|
||||
import { useParamStore } from '@/stores';
|
||||
import { ref, onMounted } from 'vue'
|
||||
import CardParameter from '@/components/CardParameter.vue'
|
||||
import TableParameter from '@/components/TableParameter.vue'
|
||||
import { sort } from 'semver';
|
||||
const store = useParamStore()
|
||||
const chain = ref(store.chain)
|
||||
onMounted(() => {
|
||||
// fetch the data
|
||||
store.initial()
|
||||
})
|
||||
import { ref, onMounted } from 'vue';
|
||||
import CardParameter from '@/components/CardParameter.vue';
|
||||
import TableParameter from '@/components/TableParameter.vue';
|
||||
|
||||
const store = useParamStore();
|
||||
const chain = ref(store.chain);
|
||||
onMounted(() => {
|
||||
// fetch the data
|
||||
store.initial();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<!-- Chain ID -->
|
||||
<div class="bg-card px-4 pt-3 pb-4 rounded">
|
||||
<div class="text-base mb-3 text-main">{{ chain.title }}</div>
|
||||
<div class="grid grid-cols-5 gap-4">
|
||||
<div v-for="(item,index) of chain.items" :key="index" class="rounded-sm bg-active px-4 py-2">
|
||||
<div class="text-xs mb-2 text-secondary">{{ item.subtitle }}</div>
|
||||
<div class="text-base text-main">{{ item.value }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<!-- Chain ID -->
|
||||
<div class="bg-card px-4 pt-3 pb-4 rounded">
|
||||
<div class="text-base mb-3 text-main">{{ chain.title }}</div>
|
||||
<div
|
||||
class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 2xl:grid-cols-6 gap-4"
|
||||
>
|
||||
<div
|
||||
v-for="(item, index) of chain.items"
|
||||
:key="index"
|
||||
class="rounded-sm bg-active px-4 py-2"
|
||||
>
|
||||
<div class="text-xs mb-2 text-secondary">{{ item.subtitle }}</div>
|
||||
<div class="text-base text-main">{{ item.value }}</div>
|
||||
</div>
|
||||
<!-- minting Parameters -->
|
||||
<CardParameter :cardItem="store.mint"/>
|
||||
<!-- Staking Parameters -->
|
||||
<CardParameter :cardItem="store.staking"/>
|
||||
<!-- Governance Parameters -->
|
||||
<CardParameter :cardItem="store.gov"/>
|
||||
<!-- Distribution Parameters -->
|
||||
<CardParameter :cardItem="store.distribution"/>
|
||||
<!-- Slashing Parameters -->
|
||||
<CardParameter :cardItem="store.slashing"/>
|
||||
<!-- Application Version -->
|
||||
<TableParameter :tableItem="store.appVersion"/>
|
||||
<!-- Node Information -->
|
||||
<TableParameter :tableItem="store.nodeVersion"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- minting Parameters -->
|
||||
<CardParameter :cardItem="store.mint" />
|
||||
<!-- Staking Parameters -->
|
||||
<CardParameter :cardItem="store.staking" />
|
||||
<!-- Governance Parameters -->
|
||||
<CardParameter :cardItem="store.gov" />
|
||||
<!-- Distribution Parameters -->
|
||||
<CardParameter :cardItem="store.distribution" />
|
||||
<!-- Slashing Parameters -->
|
||||
<CardParameter :cardItem="store.slashing" />
|
||||
<!-- Application Version -->
|
||||
<TableParameter :tableItem="store.appVersion" />
|
||||
<!-- Node Information -->
|
||||
<TableParameter :tableItem="store.nodeVersion" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<route>
|
||||
{
|
||||
meta: {
|
||||
meta: {
|
||||
i18n: 'parameters'
|
||||
}
|
||||
}
|
||||
}
|
||||
</route>
|
||||
</route>
|
||||
|
Loading…
Reference in New Issue
Block a user