feat: Card

This commit is contained in:
Alisa | Side.one
2023-05-12 21:47:43 +08:00
parent 19fbeb8ffd
commit d5b71cf5f2
8 changed files with 26 additions and 154 deletions
-5
View File
@@ -1,9 +1,4 @@
<script lang="ts" setup>
import { toBase64 } from '@cosmjs/encoding';
import type { PropType } from 'vue';
import { computed } from '@vue/reactivity';
import DynamicComponentVue from './DynamicComponent.vue';
import { select } from './index';
import ArrayBytesElement from './ArrayBytesElement.vue';
import ArrayObjectElement from './ArrayObjectElement.vue';
import TextElement from './TextElement.vue';
-1
View File
@@ -1,5 +1,4 @@
<script lang="ts" setup>
import DynamicComponent from './DynamicComponent.vue';
import { select } from './index';
const props = defineProps(['value']);
@@ -1,7 +1,6 @@
<script lang="ts" setup>
import DynamicComponent from './DynamicComponent.vue';
import { select } from './index';
import { ref} from 'vue'
import { ref } from 'vue';
const props = defineProps(['value']);
const tab = ref(Object.keys(props.value)[0] || '');
@@ -12,16 +11,19 @@ const changeTab = (val: string) => {
<template>
<div>
<div class="tabs">
<a class="tab tab-bordered text-gray-400 uppercase"
v-for="(item, index) of value" :value="index"
:class="{ 'tab-active':tab === String(index) }"
<a
class="tab tab-bordered text-gray-400 uppercase"
v-for="(item, index) of value"
:value="index"
:class="{ 'tab-active': tab === String(index) }"
@click="changeTab(String(index))"
>{{ index }}</a>
>{{ index }}</a
>
</div>
<div class="min-h-[25px] mt-4">
<div v-for="(v, k) of value" :value="k">
<DynamicComponent :value="v" v-show="tab === String(k)"/>
</div>
<div v-for="(v, k) of value" :value="k">
<DynamicComponent :value="v" v-show="tab === String(k)" />
</div>
</div>
</div>
</template>